this class represents a TCP/IP based transport connection which can be a transparent TCP/IP socket communication or a secure transport protocol such as TLS.
More...
|
DcmNativeSocketType | getSocket () |
| returns the socket file descriptor managed by this object. More...
|
|
void | setSocket (DcmNativeSocketType socket) |
| set the socket file descriptor managed by this object. More...
|
|
|
DcmNativeSocketType | theSocket |
| the socket file descriptor/handle used by the transport connection.
|
|
OFBool | isForkedParent |
| a flag that must be set in the parent process after a fork() if the TLS connection is handled by the child process. More...
|
|
this class represents a TCP/IP based transport connection which can be a transparent TCP/IP socket communication or a secure transport protocol such as TLS.
◆ DcmTransportConnection()
DcmTransportConnection::DcmTransportConnection |
( |
DcmNativeSocketType |
openSocket | ) |
|
constructor.
- Parameters
-
openSocket | TCP/IP socket to be used for the transport connection. the connection must already be established on socket level. This object takes over control of the socket. |
◆ clientSideHandshake()
virtual OFCondition DcmTransportConnection::clientSideHandshake |
( |
| ) |
|
|
pure virtual |
performs client side handshake on established socket.
This function is used to establish a secure transport connection over the established TCP connection. Abstract method.
- Returns
- EC_Normal if successful, an error code otherwise.
Implemented in DcmTLSConnection, and DcmTCPConnection.
◆ close()
virtual void DcmTransportConnection::close |
( |
| ) |
|
|
pure virtual |
Closes the transport connection.
If a secure connection is used, a closure alert is sent before the connection is closed. Abstract method.
Implemented in DcmTLSConnection, and DcmTCPConnection.
◆ closeTransportConnection()
virtual void DcmTransportConnection::closeTransportConnection |
( |
| ) |
|
|
pure virtual |
Closes the transport connection directly.
If a secure connection is used, a closure alert is NOT sent before the connection is closed. Abstract method.
Implemented in DcmTLSConnection, and DcmTCPConnection.
◆ dumpConnectionParameters() [1/2]
virtual OFString& DcmTransportConnection::dumpConnectionParameters |
( |
OFString & |
str | ) |
|
|
pure virtual |
dump the characteristics of the current connection
- Parameters
-
str | the string to dump into |
- Returns
- reference to string
Implemented in DcmTLSConnection, and DcmTCPConnection.
◆ dumpConnectionParameters() [2/2]
OFdeprecated void DcmTransportConnection::dumpConnectionParameters |
( |
STD_NAMESPACE ostream & |
out | ) |
|
◆ fastSelectReadableAssociation()
static OFBool DcmTransportConnection::fastSelectReadableAssociation |
( |
DcmTransportConnection * |
connections[], |
|
|
int |
connCount, |
|
|
int |
timeout |
|
) |
| |
|
staticprivate |
indicates which of the specified transport connections is ready for reading.
If none of the specified transport connections is ready for reading, this method blocks up to the specified timeout interval or until one of the connections becomes readable, whatever occurs first. This method uses the poll() or select() system call. It may only be used with an array of transparent TCP transport connections. This precondition must be assured by the caller.
- Parameters
-
connections | list of transport connections. May contain NULL entries. Upon successful return of this method, all transport connections which are not ready for reading are set to NULL in this array. |
connCount | number of entries in connections array. |
timeout | number of seconds for timeout. If timeout is 0, this method does not block. |
- Returns
- OFTrue if one or more connections are readable upon return from this method, OFFalse if no connection is ready for reading.
◆ getPeerCertificateLength()
virtual unsigned long DcmTransportConnection::getPeerCertificateLength |
( |
| ) |
|
|
pure virtual |
returns the size in bytes of the peer certificate of a secure connection.
May return 0 if connection is transparent TCP/IP.
- Returns
- peer certificate length in bytes
Implemented in DcmTLSConnection, and DcmTCPConnection.
◆ getSocket()
DcmNativeSocketType DcmTransportConnection::getSocket |
( |
| ) |
|
|
inlineprotected |
returns the socket file descriptor managed by this object.
- Returns
- socket file descriptor
◆ networkDataAvailable()
virtual OFBool DcmTransportConnection::networkDataAvailable |
( |
int |
timeout | ) |
|
|
pure virtual |
checks if data is available to be read on the transport connection.
Abstract method.
- Parameters
-
timeout | maximum number of seconds to wait if no data is available. If this parameter is 0, the function does not block. |
- Returns
- OFTrue if data is available, OFFalse otherwise.
Implemented in DcmTLSConnection, and DcmTCPConnection.
◆ read()
virtual ssize_t DcmTransportConnection::read |
( |
void * |
buf, |
|
|
size_t |
nbyte |
|
) |
| |
|
pure virtual |
attempts to read nbyte bytes from the transport connection and writes them into the given buffer.
Abstract method.
- Parameters
-
buf | buffer |
nbyte | number of bytes to read |
- Returns
- number of bytes read, negative number if unsuccessful.
Implemented in DcmTLSConnection, and DcmTCPConnection.
◆ renegotiate()
virtual OFCondition DcmTransportConnection::renegotiate |
( |
const char * |
newSuite | ) |
|
|
pure virtual |
performs a re-negotiation of the connection with different connection parameters.
Used to change the parameters of the secure transport connection. Abstract method.
- Parameters
-
newSuite | string identifying the ciphersuite to be negotiated. |
- Returns
- EC_Normal if successful, an error code otherwise.
Implemented in DcmTLSConnection, and DcmTCPConnection.
◆ safeSelectReadableAssociation()
static OFBool DcmTransportConnection::safeSelectReadableAssociation |
( |
DcmTransportConnection * |
connections[], |
|
|
int |
connCount, |
|
|
int |
timeout |
|
) |
| |
|
staticprivate |
indicates which of the specified transport connections is ready for reading.
If none of the specified transport connections is ready for reading, this method blocks up to the specified timeout interval or until one of the connections becomes readable, whatever occurs first. This method uses a safe approach that also works with secure transport connections, but which may be slower than a select() system call and consumes slightly more computation time.
- Parameters
-
connections | list of transport connections. May contain NULL entries. Upon successful return of this method, all transport connections which are not ready for reading are set to NULL in this array. |
connCount | number of entries in connections array. |
timeout | number of seconds for timeout. If timeout is 0, this method does not block. |
- Returns
- OFTrue if one or more connections are readable upon return from this method, OFFalse if no connection is ready for reading.
◆ selectReadableAssociation()
static OFBool DcmTransportConnection::selectReadableAssociation |
( |
DcmTransportConnection * |
connections[], |
|
|
int |
connCount, |
|
|
int |
timeout |
|
) |
| |
|
static |
indicates which of the specified transport connections is ready for reading.
If none of the specified transport connections is ready for reading, this method blocks up to the specified timeout interval or until one of the connections becomes readable, whatever occurs first.
- Parameters
-
connections | list of transport connections. May contain NULL entries. Upon successful return of this method, all transport connections which are not ready for reading are set to NULL in this array. |
connCount | number of entries in connections array. |
timeout | number of seconds for timeout. If timeout is 0, this method does not block. |
- Returns
- OFTrue if one or more connections are readable upon return from this method, OFFalse if no connection is ready for reading.
◆ serverSideHandshake()
virtual OFCondition DcmTransportConnection::serverSideHandshake |
( |
| ) |
|
|
pure virtual |
performs server side handshake on established socket.
This function is used to establish a secure transport connection over the established TCP connection. Abstract method.
- Returns
- EC_Normal if successful, an error code otherwise.
Implemented in DcmTLSConnection, and DcmTCPConnection.
◆ setParentProcessMode()
virtual void DcmTransportConnection::setParentProcessMode |
( |
| ) |
|
|
virtual |
this method must be called by the parent process after a fork() if the TLS connection is handled by the child process.
This will prevent the destructor in the parent process from calling SSL_shutdown().
◆ setSocket()
void DcmTransportConnection::setSocket |
( |
DcmNativeSocketType |
socket | ) |
|
|
inlineprotected |
set the socket file descriptor managed by this object.
- Parameters
-
◆ write()
virtual ssize_t DcmTransportConnection::write |
( |
void * |
buf, |
|
|
size_t |
nbyte |
|
) |
| |
|
pure virtual |
attempts to write nbyte bytes from the given buffer to the transport connection.
Abstract method.
- Parameters
-
buf | buffer |
nbyte | number of bytes to write |
- Returns
- number of bytes written, negative number if unsuccessful.
Implemented in DcmTLSConnection, and DcmTCPConnection.
◆ isForkedParent
OFBool DcmTransportConnection::isForkedParent |
|
private |
a flag that must be set in the parent process after a fork() if the TLS connection is handled by the child process.
This will prevent the destructor in the parent process from calling SSL_shutdown().
The documentation for this class was generated from the following file: