Audacity 3.2.0
Classes | Public Member Functions | Private Attributes | List of all members
IPCClient Class Referencefinal

Simple TCP socket based ipc client. When created attempts to connect to existing server (see IPCServer). More...

#include <IPCClient.h>

Collaboration diagram for IPCClient:
[legend]

Classes

class  Impl
 

Public Member Functions

 IPCClient (int port, IPCChannelStatusCallback &callback)
 Attempts to connect to a server, may fail with exception or with call to IPCChannelStatusCallback::OnConnectionError. Callback should be guaranteed to be alive until either IPCChannelStatusCallback::OnDisconnect or IPCChannelStatusCallback::OnConnectionError is called. More...
 
 ~IPCClient ()
 Closes connection if any. More...
 

Private Attributes

std::unique_ptr< ImplmImpl
 

Detailed Description

Simple TCP socket based ipc client. When created attempts to connect to existing server (see IPCServer).

Definition at line 23 of file IPCClient.h.

Constructor & Destructor Documentation

◆ IPCClient()

IPCClient::IPCClient ( int  port,
IPCChannelStatusCallback callback 
)

Attempts to connect to a server, may fail with exception or with call to IPCChannelStatusCallback::OnConnectionError. Callback should be guaranteed to be alive until either IPCChannelStatusCallback::OnDisconnect or IPCChannelStatusCallback::OnConnectionError is called.

Parameters
portTCP port number used to connect to server
callbackChannel status callback. May be accessed from working threads.

Definition at line 57 of file IPCClient.cpp.

58{
59#ifdef _WIN32
60 WSADATA wsaData;
61 auto result = WSAStartup(MAKEWORD(2, 2), &wsaData);
62 if (result != NO_ERROR)
63 throw std::runtime_error("WSAStartup failed");
64#endif
65 mImpl = std::make_unique<Impl>(port, callback);
66}
std::unique_ptr< Impl > mImpl
Definition: IPCClient.h:25

References mImpl.

◆ ~IPCClient()

IPCClient::~IPCClient ( )
default

Closes connection if any.

Member Data Documentation

◆ mImpl

std::unique_ptr<Impl> IPCClient::mImpl
private

Definition at line 26 of file IPCClient.h.

Referenced by IPCClient().


The documentation for this class was generated from the following files: