|
ATLAS Offline Software
|
Go to the documentation of this file.
8 # include <sys/types.h>
9 # include <sys/socket.h>
10 # include <netinet/in.h>
11 # include <arpa/inet.h>
19 #include <TInetAddress.h>
52 return StatusCode::FAILURE;
56 const UInt_t adr = htonl(
address.GetAddress() );
60 struct servent sp_buf;
63 getservbyport_r( htons( port ),
"tcp", &sp_buf, buf,
sizeof(buf), &sp );
67 sport = htons( port );
71 m_socket = ::socket( AF_INET, SOCK_STREAM, 0 );
73 return StatusCode::FAILURE;
79 memcpy( &
server.sin_addr, &adr,
sizeof( adr ) );
87 return StatusCode::FAILURE;
91 return StatusCode::SUCCESS;
98 return StatusCode::RECOVERABLE;
103 return StatusCode::FAILURE;
108 return StatusCode::SUCCESS;
126 return StatusCode::FAILURE;
137 for(
int i = 0;
i <
length;
i += sent ) {
140 return StatusCode::FAILURE;
141 }
else if( sent == 0 ) {
147 return StatusCode::SUCCESS;
TSocket()
Constructor with an address and a port.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
StatusCode close()
Close the current connection.
::StatusCode StatusCode
StatusCode definition for legacy code.
int m_socket
The underlying socket.
bool isConnected() const
Check if the socket is connected to some address at the moment.
StatusCode send(const TString &payload)
Function sending a message to the connected address.
StatusCode connect(const TInetAddress &address, int port)
Function connecting to the specified address.