61 bool bindToPort (
int localPortNumber);
74 bool bindToPort (
int localPortNumber,
const String& localAddress);
84 int getBoundPort()
const noexcept;
94 bool connect (
const String& remoteHostname,
96 int timeOutMillisecs = 3000);
108 int getPort() const noexcept {
return portNumber; }
111 bool isLocal()
const noexcept;
128 int waitUntilReady (
bool readyForReading,
int timeoutMsecs);
140 int read (
void* destBuffer,
int maxBytesToRead,
141 bool blockUntilSpecifiedAmountHasArrived);
150 int write (
const void* sourceBuffer,
int numBytesToWrite);
166 bool createListener (
int portNumber,
const String& localHostName =
String());
182 std::atomic<int> portNumber { 0 }, handle { -1 };
183 std::atomic<bool> connected {
false }, isListener {
false };
230 bool bindToPort (
int localPortNumber);
243 bool bindToPort (
int localPortNumber,
const String& localAddress);
252 int getBoundPort()
const noexcept;
269 int waitUntilReady (
bool readyForReading,
int timeoutMsecs);
281 int read (
void* destBuffer,
int maxBytesToRead,
282 bool blockUntilSpecifiedAmountHasArrived);
295 int read (
void* destBuffer,
int maxBytesToRead,
296 bool blockUntilSpecifiedAmountHasArrived,
297 String& senderIPAddress,
int& senderPortNumber);
306 int write (
const String& remoteHostname,
int remotePortNumber,
307 const void* sourceBuffer,
int numBytesToWrite);
330 bool joinMulticast (
const String& multicastIPAddress);
336 bool leaveMulticast (
const String& multicastIPAddress);
342 bool setMulticastLoopbackEnabled (
bool enableLoopback);
353 bool setEnablePortReuse (
bool enabled);
357 std::atomic<int> handle { -1 };
358 bool isBound =
false;
359 String lastBindAddress, lastServerHost;
360 int lastServerPort = -1;
361 void* lastServerAddress =
nullptr;
int getRawSocketHandle() const noexcept
bool isConnected() const noexcept
int getPort() const noexcept
const String & getHostName() const noexcept
int getRawSocketHandle() const noexcept