50 # pragma warning( disable : 4290) 51 # pragma warning( disable: 4275 ) // warning C4275: non dll-interface class 84 NetError(
const char* message) :
std::runtime_error(message), m_socket(nullptr) {}
86 NetError(
const char* message,
Socket* socket) :
std::runtime_error(message), m_socket(socket) {}
165 return (this->m_host == ip.m_host) && (this->m_port == ip.m_port);
225 SINGLETON_CLASSNAME_METHOD();
232 void deinitSockets();
251 #ifndef DOC_DONT_EXTRACT //direction to doxygen not to extract this class 255 #endif//~DOC_DONT_EXTRACT 266 void setBlocking(
bool flag);
279 return m_readyToReceive;
286 return m_readyToReceive;
291 return m_readyToSend;
311 static int getLastError();
369 this->open(ip, disableNaggle);
389 void open(
const IPAddress& ip,
bool disableNaggle =
false);
418 void disableNaggle();
469 this->open(port, disableNaggle);
478 void open(
agx::UInt16 port,
bool disableNaggle =
false);
491 bool m_disableNaggle;
559 size_t getMaxSockets()
const;
566 bool addSocket(
Socket *sock);
573 bool removeSocket(
Socket *sock);
a structure which holds IP address
Containins classes for sending/reading data over sockets as well as compression functionality.
TCPServerSocket & operator=(const TCPServerSocket &s)
Assignment operator, works similar to std::auto_ptr::operator=().
std::ostream & operator<<(std::ostream &stream, const IPAddress &adr)
void AGXPHYSICS_EXPORT shutdown()
Shutdown of the AGX Dynamics API will be done when the number of shutdown matches the number of calls...
IPAddress(agx::UInt32 h, agx::UInt16 p)
Create IP address specifying exact ip address and port number.
static agx::String parseString(agx::UInt8 *&buffer, agx::UInt8 *)
const agx::UInt32 & host() const
bool operator==(const IPAddress &ip)
compares two IP addresses for equality.
TimeoutConnectError(const char *message)
Exception constructor.
virtual ~TimeoutConnectError() noexcept
virtual ~SocketSet()
Destroys the socket set.
#define AGX_DECLARE_POINTER_TYPES(type)
size_t getNumSockets() const
Returns number of sockets the socket set currently holds.
Base class providing referencing counted objects.
SystemIndependentSocketHandle m_socket
Socket & operator=(const Socket &s)
const SocketRefVector & getSockets() const
TCPServerSocket(agx::UInt16 port, bool disableNaggle=false)
A constructor which automatically calls TCPServerSocket::Open() method.
TCPServerSocket()
Creates an invalid (unopened) TCP server socket.
IPAddress(agx::UInt8 h1, agx::UInt8 h2, agx::UInt8 h3, agx::UInt8 h4, agx::UInt16 p)
Create IP address specifying exact ip address as 4 bytes and port number.
agx::UInt16 AGXCORE_EXPORT getAvailablePort()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
TCPServerSocket(const TCPServerSocket &s)
A copy constructor.
NetError(const char *message, Socket *socket)
TCPSocket & operator=(const TCPSocket &s)
Assignment operator, works similar to std::auto_ptr::operator=().
bool readyToReceive() const
virtual ~Socket()
Destructor.
const agx::UInt16 & port() const
const IPAddress & adr() const
bool isReady() const
Tells whether there is some activity on the socket or not.
TCPSocket()
Constructs an invalid TCP socket object.
NetError(const char *message)
Exception constructor.
TCPSocket(const TCPSocket &s, const IPAddress &adr=IPAddress())
A copy constructor.
Indicates a timeout between server/client.
#define AGX_DECLARE_VECTOR_TYPES(type)
TCPSocket(const IPAddress &ip, bool disableNaggle=false)
A constructor which automatically calls TCPSocket::Open() method.
Base class for Singletons that should have its shutdown called explicitly before exit of the applicat...