42 if (socket->createListener (portNumber,
bindAddress))
56 if (socket !=
nullptr)
65 return (socket ==
nullptr) ? -1 : socket->getBoundPort();
68void InterprocessConnectionServer::run()
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.
bool startThread()
Attempts to start a new thread with default ('Priority::normal') priority.
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.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...