ATLAS Offline Software
|
Very simple wrapper around POSIX sockets. More...
#include <TSocket.h>
Public Member Functions | |
TSocket () | |
Constructor with an address and a port. More... | |
~TSocket () | |
Destructor. More... | |
TSocket (const TSocket &)=delete | |
Do not allow object copying. More... | |
TSocket & | operator= (const TSocket &)=delete |
Do not allow assignment. More... | |
StatusCode | connect (const TInetAddress &address, int port) |
Function connecting to the specified address. More... | |
StatusCode | close () |
Close the current connection. More... | |
bool | isConnected () const |
Check if the socket is connected to some address at the moment. More... | |
StatusCode | send (const TString &payload) |
Function sending a message to the connected address. More... | |
Private Attributes | |
int | m_socket |
The underlying socket. More... | |
Very simple wrapper around POSIX sockets.
Since ROOT's TSocket is not fit to be used in TFileAccessTracer's destructor (as some ROOT infrastructure may not be available by the time the destructor is called), we need our own simple implementation instead.
Most of the implementation is simply a copy of the code from TUnixSystem. Slightly simplified in some cases where we don't need the flexibility of the ROOT implementation.
xAOD::TSocket::TSocket | ( | ) |
Constructor with an address and a port.
Definition at line 26 of file TSocket.cxx.
xAOD::TSocket::~TSocket | ( | ) |
StatusCode xAOD::TSocket::close | ( | ) |
Function connecting to the specified address.
It turns out that translating a string address name into an integer address that the connect(...) function understands, is no easy feat.
So instead we leave that up to ROOT. This translation just needs to be done "early enough" in the job when ROOT can still do it.
address | The address to send the data to |
port | The port number to connect to #returns The usual return codes... |
Definition at line 48 of file TSocket.cxx.
bool xAOD::TSocket::isConnected | ( | ) | const |
Check if the socket is connected to some address at the moment.
Definition at line 111 of file TSocket.cxx.
StatusCode xAOD::TSocket::send | ( | const TString & | payload | ) |
Function sending a message to the connected address.
This function is custom made for our use case.
It sends HTML style information to the connected server.
payload | The HTML style payload to send to the server |
Definition at line 122 of file TSocket.cxx.