23 class UDPSocket :
public FileDescriptor {
25 friend class TCPServerSocket;
29 UDPSocket(
unsigned int port);
30 UDPSocket(
unsigned int port,
31 const std::string& hostname,
32 bool boardcast =
false);
33 UDPSocket(
unsigned int port,
35 bool boardcast =
false);
36 virtual ~UDPSocket() {}
40 int bind(
unsigned int port,
41 const std::string& hostname =
"",
42 bool broadcast =
true);
43 const std::string getHostName()
const;
44 unsigned int getPort()
const;
45 unsigned int getAddress()
const;
46 const std::string getRemoteHostName()
const;
47 unsigned int getRemotePort()
const;
48 unsigned int getRemoteAddress()
const;
51 virtual size_t write(
const void* v,
size_t count);
52 virtual size_t read(
void* v,
size_t count);
55 struct sockaddr_in m_addr;
56 struct sockaddr_in m_remote_addr;
59 static unsigned int findSubnet(
unsigned int addr);