Browse Source

Add possibility for an InterprocessConnectionServer to bind to a certain network address

tags/2021-05-28
hogliux 9 years ago
parent
commit
5e0d3fdcbe
2 changed files with 10 additions and 3 deletions
  1. +2
    -2
      modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp
  2. +8
    -1
      modules/juce_events/interprocess/juce_InterprocessConnectionServer.h

+ 2
- 2
modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp View File

@@ -33,13 +33,13 @@ InterprocessConnectionServer::~InterprocessConnectionServer()
}
//==============================================================================
bool InterprocessConnectionServer::beginWaitingForSocket (const int portNumber)
bool InterprocessConnectionServer::beginWaitingForSocket (const int portNumber, const String& bindAddress)
{
stop();
socket = new StreamingSocket();
if (socket->createListener (portNumber))
if (socket->createListener (portNumber, bindAddress))
{
startThread();
return true;


+ 8
- 1
modules/juce_events/interprocess/juce_InterprocessConnectionServer.h View File

@@ -57,9 +57,16 @@ public:
Use stop() to stop the thread running.
@param portNumber The port on which the server will receive
connections
@param bindAddress The address on which the server will listen
for connections. An empty string indicates
that it should listen on all addresses
assigned to this machine.
@see createConnectionObject, stop
*/
bool beginWaitingForSocket (int portNumber);
bool beginWaitingForSocket (int portNumber, const String& bindAddress = String());
/** Terminates the listener thread, if it's active.


Loading…
Cancel
Save