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

Simple TCP socket based ipc server. When created server starts to listen for incoming connection (see IPCClient). More...

#include <IPCServer.h>

Collaboration diagram for IPCServer:
[legend]

Classes

class  Impl
 

Public Member Functions

 IPCServer (IPCChannelStatusCallback &callback)
 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...
 
 ~IPCServer ()
 Closes connection if any. More...
 
int GetConnectPort () const noexcept
 

Private Attributes

std::unique_ptr< ImplmImpl
 

Detailed Description

Simple TCP socket based ipc server. When created server starts to listen for incoming connection (see IPCClient).

Definition at line 24 of file IPCServer.h.

Constructor & Destructor Documentation

◆ IPCServer()

IPCServer::IPCServer ( IPCChannelStatusCallback callback)

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
callbackChannel status callback. May be accessed from working threads.

Definition at line 136 of file IPCServer.cpp.

137{
138#ifdef _WIN32
139 WSADATA wsaData;
140 auto result = WSAStartup(MAKEWORD(2, 2), &wsaData);
141 if (result != NO_ERROR)
142 throw std::runtime_error("WSAStartup failed");
143#endif
144 mImpl = std::make_unique<Impl>(callback);
145}
std::unique_ptr< Impl > mImpl
Definition: IPCServer.h:26

References mImpl.

◆ ~IPCServer()

IPCServer::~IPCServer ( )
default

Closes connection if any.

Member Function Documentation

◆ GetConnectPort()

int IPCServer::GetConnectPort ( ) const
noexcept

Returns port number to connect to. Valid until connection is established.

Definition at line 149 of file IPCServer.cpp.

150{
151 return mImpl->GetConnectPort();
152}

References mImpl.

Member Data Documentation

◆ mImpl

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

Definition at line 27 of file IPCServer.h.

Referenced by GetConnectPort(), and IPCServer().


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