OpenShot Library | libopenshot-audio
0.2.0
|
42 if (socket->createListener (portNumber, bindAddress))
56 if (socket !=
nullptr)
65 return (socket ==
nullptr) ? -1 : socket->getBoundPort();
68 void InterprocessConnectionServer::run()
72 std::unique_ptr<StreamingSocket> clientSocket (socket->waitForNextConnection());
74 if (clientSocket !=
nullptr)
76 newConnection->initialiseWithSocket (clientSocket.release());
~InterprocessConnectionServer() override
Destructor.
void startThread()
Starts the thread running.
int getBoundPort() const noexcept
Returns the local port number to which this server is currently bound.
bool threadShouldExit() const
Checks whether the thread has been told to stop running.
virtual InterprocessConnection * createConnectionObject()=0
Creates a suitable connection object for a client process that wants to connect to this one.
bool beginWaitingForSocket(int portNumber, const String &bindAddress=String())
Starts an internal thread which listens on the given port number.
A wrapper for a streaming (TCP) socket.
void signalThreadShouldExit()
Sets a flag to tell the thread it should stop.
bool stopThread(int timeOutMilliseconds)
Attempts to stop the thread running.
void stop()
Terminates the listener thread, if it's active.
InterprocessConnectionServer()
Creates an uninitialised server object.