simple-socket library 1.1.5

UDPSocket.h

Go to the documentation of this file.
00001 #ifndef NET_UDPSocket_h__
00002 #define NET_UDPSocket_h__
00003 
00004 #include "InternetSocket.h"
00005 
00006 namespace NET
00007 {
00009     class UDPSocket : public InternetSocket
00010     {
00011     public:
00016         UDPSocket();
00017 
00037         void sendTo( const void* buffer, size_t bufferLen, const std::string& foreignAddress, unsigned short foreignPort);
00038 
00053         int receiveFrom( void* buffer, size_t len, std::string& sourceAddress, unsigned short& sourcePort);
00054 
00072         int timedReceiveFrom( void* buffer, size_t len, std::string& sourceAddress, unsigned short& sourcePort, int timeout);
00073 
00079         void setMulticastTTL( unsigned char multicastTTL);
00080 
00089         void joinGroup( const std::string& multicastGroup);
00090 
00099         void leaveGroup( const std::string& multicastGroup);
00100     };
00101 
00102 } // namespace NET
00103 
00104 #endif // NET_UDPSocket_h__