Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions net/net/src/TPServerSocket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

//////////////////////////////////////////////////////////////////////////
// //
// TPServerSocket //
// //
// This class implements parallel server sockets. A parallel server //
// socket waits for requests to come in over the network. It performs //
// some operation based on that request and then possibly returns a //
// full duplex parallel socket to the requester. The actual work is //
// done via the TSystem class (either TUnixSystem or TWinNTSystem). //
// //
//////////////////////////////////////////////////////////////////////////
/**
\file TPServerSocket.cxx
\class TPServerSocket
\brief This class implements parallel server sockets.
\note This class deals with sockets: the user is entirely responsible for the security of their usage, for example, but
not limited to, the management of the connections to said sockets.

This class implements parallel server sockets. A parallel server
socket waits for requests to come in over the network. It performs
some operation based on that request and then possibly returns a
full duplex parallel socket to the requester. The actual work is
done via the TSystem class (either TUnixSystem or TWinNTSystem).
**/

#include "TPServerSocket.h"
#include "TROOT.h"
Expand Down
30 changes: 19 additions & 11 deletions net/net/src/TPSocket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

//////////////////////////////////////////////////////////////////////////
// //
// 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). //
// //
//////////////////////////////////////////////////////////////////////////
/**
\file TPSocket.cxx
\class TPSocket
\brief This class implements parallel server sockets.
\note This class deals with sockets: the user is entirely responsible for the security of their usage, for example, but
not limited to, the management of the connections to said 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).

**/

#include "TPSocket.h"
#include "TUrl.h"
Expand All @@ -32,6 +34,7 @@
#include "TError.h"
#include "TVirtualMutex.h"

#include <limits>

////////////////////////////////////////////////////////////////////////////////
/// Create a parallel socket. Connect to the named service at address addr.
Expand Down Expand Up @@ -641,6 +644,11 @@ Int_t TPSocket::Recv(TMessage *&mess)
}
len = net2host(len); //from network to host byte order

if (len > (std::numeric_limits<decltype(len)>::max() - sizeof(decltype(len)))) {
Error("Recv", "Buffer length is %u and %u+sizeof(UInt_t) cannot be represented as an UInt_t.", len, len);
return -1;
}

char *buf = new char[len+sizeof(UInt_t)];
if ((n = RecvRaw(buf+sizeof(UInt_t), len, kDefault)) <= 0) {
delete [] buf;
Expand Down
15 changes: 8 additions & 7 deletions net/net/src/TSSLSocket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

//////////////////////////////////////////////////////////////////////////
// //
// TSSLSocket //
// //
// A TSocket wrapped in by SSL. //
// //
//////////////////////////////////////////////////////////////////////////
/**
\file TSSLSocket.cxx
\class TSSLSocket
\brief A TSocket wrapped in by SSL.
\note This class deals with sockets: the user is entirely responsible for the security of their usage, for example, but
not limited to, the management of the connections to said sockets.
**/


#include <openssl/ssl.h>
#include "TSSLSocket.h"
Expand Down
26 changes: 15 additions & 11 deletions net/net/src/TServerSocket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

//////////////////////////////////////////////////////////////////////////
// //
// TServerSocket //
// //
// This class implements server sockets. A server socket waits for //
// requests to come in over the network. It performs some operation //
// based on that request and then possibly returns a full duplex socket //
// to the requester. The actual work is done via the TSystem class //
// (either TUnixSystem or TWinNTSystem). //
// //
//////////////////////////////////////////////////////////////////////////
/**
\file TServerSocket.cxx
\class TServerSocket
\brief This class implements server sockets.
\note This class deals with sockets: the user is entirely responsible for the security of their usage, for example, but
not limited to, the management of the connections to said sockets.

This class implements server sockets. A server socket waits for
requests to come in over the network. It performs some operation
based on that request and then possibly returns a full duplex socket
to the requester. The actual work is done via the TSystem class
(either TUnixSystem or TWinNTSystem).

**/


#include "TServerSocket.h"
#include "TSocket.h"
Expand Down
27 changes: 17 additions & 10 deletions net/net/src/TSocket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

//////////////////////////////////////////////////////////////////////////
// //
// TSocket //
// //
// This class implements client sockets. A socket is an endpoint for //
// communication between two machines. //
// The actual work is done via the TSystem class (either TUnixSystem //
// or TWinNTSystem). //
// //
//////////////////////////////////////////////////////////////////////////
/**
\file TSocket.cxx
\class TSocket
\brief This class implements client sockets.
\note This class deals with sockets: the user is entirely responsible for the security of their usage, for example, but
not limited to, the management of the connections to said sockets.

A socket is an endpoint for communication between two machines. The actual work is done via the TSystem class (either
TUnixSystem or TWinNTSystem).

**/

#include "Bytes.h"
#include "Compression.h"
Expand All @@ -36,6 +37,7 @@
#include "TStreamerInfo.h"
#include "TProcessID.h"

#include <limits>

ULong64_t TSocket::fgBytesSent = 0;
ULong64_t TSocket::fgBytesRecv = 0;
Expand Down Expand Up @@ -829,6 +831,11 @@ Int_t TSocket::Recv(TMessage *&mess)
}
len = net2host(len); //from network to host byte order

if (len > (std::numeric_limits<decltype(len)>::max() - sizeof(decltype(len)))) {
Error("Recv", "Buffer length is %u and %u+sizeof(UInt_t) cannot be represented as an UInt_t.", len, len);
return -1;
}

ResetBit(TSocket::kBrokenConn);
char *buf = new char[len+sizeof(UInt_t)];
if ((n = gSystem->RecvRaw(fSocket, buf+sizeof(UInt_t), len, 0)) <= 0) {
Expand Down
27 changes: 17 additions & 10 deletions net/net/src/TUDPSocket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

//////////////////////////////////////////////////////////////////////////
// //
// TUDPSocket //
// //
// This class implements UDP client sockets. A socket is an endpoint //
// for communication between two machines. //
// The actual work is done via the TSystem class (either TUnixSystem //
// or TWinNTSystem). //
// //
//////////////////////////////////////////////////////////////////////////
/**
\file TUDPSocket.cxx
\class TUDPSocket
\brief This class implements UDP client sockets.
\note This class deals with sockets: the user is entirely responsible for the security of their usage, for example, but
not limited to, the management of the connections to said sockets.

A socket is an endpoint for communication between two machines. The actual work is done via the TSystem class (either
TUnixSystem or TWinNTSystem).
**/

#include "Bytes.h"
#include "Compression.h"
Expand All @@ -36,6 +36,8 @@
#include "TStreamerInfo.h"
#include "TProcessID.h"

#include <limits>

ULong64_t TUDPSocket::fgBytesSent = 0;
ULong64_t TUDPSocket::fgBytesRecv = 0;

Expand Down Expand Up @@ -796,6 +798,11 @@ Int_t TUDPSocket::Recv(TMessage *&mess)
}
len = net2host(len); //from network to host byte order

if (len > (std::numeric_limits<decltype(len)>::max() - sizeof(decltype(len)))) {
Error("Recv", "Buffer length is %u and %u+sizeof(UInt_t) cannot be represented as an UInt_t.", len, len);
return -1;
}

ResetBit(TUDPSocket::kBrokenConn);
char *buf = new char[len+sizeof(UInt_t)];
if ((n = gSystem->RecvRaw(fSocket, buf+sizeof(UInt_t), len, 0)) <= 0) {
Expand Down
Loading