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