ATLAS Offline Software
TSocket.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 //
3 // Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 //
5 #ifndef XAODROOTACCESS_TOOLS_TSOCKET_H
6 #define XAODROOTACCESS_TOOLS_TSOCKET_H
7 
8 // Local include(s):
10 
11 // Forward declaration(s):
12 class TString;
13 class TInetAddress;
14 
15 namespace xAOD {
16 
29  class TSocket {
30 
31  public:
33  TSocket();
35  ~TSocket();
36 
38  TSocket( const TSocket& ) = delete;
40  TSocket& operator=( const TSocket& ) = delete;
41 
43  StatusCode connect( const TInetAddress& address, int port );
45  StatusCode close();
46 
48  bool isConnected() const;
49 
51  StatusCode send( const TString& payload );
52 
53  private:
55  int m_socket;
56 
57  }; // class TSocket
58 
59 } // namespace xAOD
60 
61 #endif // XAODROOTACCESS_TOOLS_TSOCKET_H
xAOD::TSocket
Very simple wrapper around POSIX sockets.
Definition: TSocket.h:29
xAOD::TSocket::TSocket
TSocket(const TSocket &)=delete
Do not allow object copying.
xAOD::TSocket::TSocket
TSocket()
Constructor with an address and a port.
Definition: TSocket.cxx:27
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::TSocket::close
StatusCode close()
Close the current connection.
Definition: TSocket.cxx:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TSocket::operator=
TSocket & operator=(const TSocket &)=delete
Do not allow assignment.
StatusCode.h
xAOD::TSocket::m_socket
int m_socket
The underlying socket.
Definition: TSocket.h:55
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
xAOD::TSocket::isConnected
bool isConnected() const
Check if the socket is connected to some address at the moment.
Definition: TSocket.cxx:109
xAOD::TSocket::~TSocket
~TSocket()
Destructor.
Definition: TSocket.cxx:32
xAOD::TSocket::send
StatusCode send(const TString &payload)
Function sending a message to the connected address.
Definition: TSocket.cxx:120
xAOD::TSocket::connect
StatusCode connect(const TInetAddress &address, int port)
Function connecting to the specified address.
Definition: TSocket.cxx:49