library: libCore #include "TPSocket.h" |
TPSocket
class description - source file - inheritance tree (.pdf)
private:
TPSocket(TSocket** pSockets, Int_t size)
TPSocket(const TPSocket&)
virtual Option_t* GetOption() const
void Init(Int_t tcpwindowsize, TSocket* sock = 0)
void operator=(const TPSocket&)
public:
TPSocket(TInetAddress address, const char* service, Int_t size, Int_t tcpwindowsize = -1)
TPSocket(TInetAddress address, Int_t port, Int_t size, Int_t tcpwindowsize = -1)
TPSocket(const char* host, const char* service, Int_t size, Int_t tcpwindowsize = -1)
TPSocket(const char* host, Int_t port, Int_t size, Int_t tcpwindowsize = -1)
TPSocket(const char* host, Int_t port, Int_t size, TSocket* sock)
virtual ~TPSocket()
static TClass* Class()
virtual void Close(Option_t* opt = "")
virtual Int_t GetDescriptor() const
Int_t GetErrorCode() const
virtual TInetAddress GetLocalInetAddress()
virtual Int_t GetOption(ESockOptions opt, Int_t& val)
Int_t GetSize() const
virtual TClass* IsA() const
virtual Bool_t IsValid() const
virtual Int_t Recv(TMessage*& mess)
virtual Int_t Recv(Int_t& status, Int_t& kind)
virtual Int_t Recv(char* mess, Int_t max)
virtual Int_t Recv(char* mess, Int_t max, Int_t& kind)
virtual Int_t RecvRaw(void* buffer, Int_t length, ESendRecvOptions opt)
virtual Int_t Send(const TMessage& mess)
virtual Int_t Send(Int_t kind)
virtual Int_t Send(Int_t status, Int_t kind)
virtual Int_t Send(const char* mess, Int_t kind = kMESS_STRING)
virtual Int_t SendRaw(const void* buffer, Int_t length, ESendRecvOptions opt)
virtual Int_t SetOption(ESockOptions opt, Int_t val)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
private:
TSocket** fSockets array of parallel sockets
TMonitor* fWriteMonitor monitor write on parallel sockets
TMonitor* fReadMonitor monitor read from parallel sockets
Int_t fSize number of parallel sockets
Int_t* fWriteBytesLeft bytes left to write for specified socket
Int_t* fReadBytesLeft bytes left to read for specified socket
char** fWritePtr pointer to write buffer for specified socket
char** fReadPtr pointer to read buffer for specified socket
TPSocket
This class implements parallel client sockets. A parallel socket is
an endpoint for communication between two machines. It is parallel
because several TSockets are open at the same time to the same
destination. This especially speeds up communication over Big Fat
Pipes (i.e. high bandwidth, high latency WAN connections).
TPSocket(TInetAddress addr, const char *service, Int_t size,
Int_t tcpwindowsize) : TSocket(addr, service)
Create a parallel socket. Connect to the named service at address addr.
Use tcpwindowsize to specify the size of the receive buffer, it has
to be specified here to make sure the window scale option is set (for
tcpwindowsize > 65KB and for platforms supporting window scaling).
Returns when connection has been accepted by remote side. Use IsValid()
to check the validity of the socket. Every socket is added to the TROOT
sockets list which will make sure that any open sockets are properly
closed on program termination.
TPSocket(TInetAddress addr, Int_t port, Int_t size,
Int_t tcpwindowsize) : TSocket(addr, port)
Create a parallel socket. Connect to the specified port # at address addr.
Use tcpwindowsize to specify the size of the receive buffer, it has
to be specified here to make sure the window scale option is set (for
tcpwindowsize > 65KB and for platforms supporting window scaling).
Returns when connection has been accepted by remote side. Use IsValid()
to check the validity of the socket. Every socket is added to the TROOT
sockets list which will make sure that any open sockets are properly
closed on program termination.
TPSocket(const char *host, const char *service, Int_t size,
Int_t tcpwindowsize) : TSocket(host, service)
Create a parallel socket. Connect to named service on the remote host.
Use tcpwindowsize to specify the size of the receive buffer, it has
to be specified here to make sure the window scale option is set (for
tcpwindowsize > 65KB and for platforms supporting window scaling).
Returns when connection has been accepted by remote side. Use IsValid()
to check the validity of the socket. Every socket is added to the TROOT
sockets list which will make sure that any open sockets are properly
closed on program termination.
TPSocket(const char *host, Int_t port, Int_t size,
Int_t tcpwindowsize)
: TSocket(host, port, (Int_t)(size > 1 ? -1 : tcpwindowsize))
Create a parallel socket. Connect to specified port # on the remote host.
Use tcpwindowsize to specify the size of the receive buffer, it has
to be specified here to make sure the window scale option is set (for
tcpwindowsize > 65KB and for platforms supporting window scaling).
Returns when connection has been accepted by remote side. Use IsValid()
to check the validity of the socket. Every socket is added to the TROOT
sockets list which will make sure that any open sockets are properly
closed on program termination.
TPSocket(const char *host, Int_t port, Int_t size, TSocket *sock)
Create a parallel socket on a connection already opened via
TSocket sock.
This constructor is provided to optimize TNetFile opening when
instatiated via a call to TXNetFile.
Returns when connection has been accepted by remote side. Use IsValid()
to check the validity of the socket. Every socket is added to the TROOT
sockets list which will make sure that any open sockets are properly
closed on program termination.
TPSocket(TSocket *pSockets[], Int_t size)
Create a parallel socket. This ctor is called by TPServerSocket.
~TPSocket()
Cleanup the parallel socket.
void Close(Option_t *option)
Close a parallel socket. If option is "force", calls shutdown(id,2) to
shut down the connection. This will close the connection also
for the parent of this process. Also called via the dtor (without
option "force", call explicitely Close("force") if this is desired).
void Init(Int_t tcpwindowsize, TSocket *sock)
Create a parallel socket to the specified host.
TInetAddress GetLocalInetAddress()
Return internet address of local host to which the socket is bound.
In case of error TInetAddress::IsValid() returns kFALSE.
Int_t GetDescriptor() const
Return socket descriptor
Int_t Send(const TMessage &mess)
Send a TMessage object. Returns the number of bytes in the TMessage
that were sent and -1 in case of error. In case the TMessage::What
has been or'ed with kMESS_ACK, the call will only return after having
received an acknowledgement, making the sending process synchronous.
Returns -4 in case of kNoBlock and errno == EWOULDBLOCK.
Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt)
Send a raw buffer of specified length. Returns the number of bytes
send and -1 in case of error.
Int_t Recv(TMessage *&mess)
Receive a TMessage object. The user must delete the TMessage object.
Returns length of message in bytes (can be 0 if other side of connection
is closed) or -1 in case of error or -4 in case a non-blocking socket would
block (i.e. there is nothing to be read). In those case mess == 0.
Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt)
Send a raw buffer of specified length. Returns the number of bytes
sent or -1 in case of error.
Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
Int_t GetOption(ESockOptions opt, Int_t &val)
Get socket options. Returns -1 in case of error.
Int_t GetErrorCode() const
Returns error code. Meaning depends on context where it is called.
If no error condition returns 0 else a value < 0.
Inline Functions
void operator=(const TPSocket&)
TPSocket TPSocket(const char* host, Int_t port, Int_t size, TSocket* sock)
Int_t Send(Int_t kind)
Int_t Send(Int_t status, Int_t kind)
Int_t Send(const char* mess, Int_t kind = kMESS_STRING)
Int_t Recv(Int_t& status, Int_t& kind)
Int_t Recv(char* mess, Int_t max)
Int_t Recv(char* mess, Int_t max, Int_t& kind)
Bool_t IsValid() const
Int_t GetOption(ESockOptions opt, Int_t& val)
Int_t GetSize() const
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
Author: Fons Rademakers 22/1/2001
Last update: root/net:$Name: $:$Id: TPSocket.cxx,v 1.22 2005/06/23 06:24:27 brun Exp $
Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.