1 #ifndef _B2ARICH_UDPSocket_hh_
2 #define _B2ARICH_UDPSocket_hh_
6 #include <netinet/in.h>
8 #include "daq/slc/system/FileDescriptor.h"
24 const std::string& hostname,
25 bool boardcast =
false);
28 bool boardcast =
false);
33 int bind(
unsigned int port,
34 const std::string& hostname =
"",
35 bool broadcast =
true);
36 const std::string getHostName()
const;
37 unsigned int getPort()
const;
38 unsigned int getAddress()
const;
39 const std::string getRemoteHostName()
const;
40 unsigned int getRemotePort()
const;
41 unsigned int getRemoteAddress()
const;
44 virtual size_t write(
const void* v,
size_t count);
45 virtual size_t read(
void* v,
size_t count);
48 struct sockaddr_in m_addr;
49 struct sockaddr_in m_remote_addr;
52 static unsigned int findSubnet(
unsigned int addr);