DCMTK
Version 3.6.5
OFFIS DICOM Toolkit
|
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...
Public Member Functions | |
DcmTransportConnection (DcmNativeSocketType openSocket) | |
constructor. More... | |
virtual | ~DcmTransportConnection () |
destructor | |
virtual DcmTransportLayerStatus | serverSideHandshake ()=0 |
performs server side handshake on established socket. More... | |
virtual DcmTransportLayerStatus | clientSideHandshake ()=0 |
performs client side handshake on established socket. More... | |
virtual DcmTransportLayerStatus | renegotiate (const char *newSuite)=0 |
performs a re-negotiation of the connection with different connection parameters. More... | |
virtual ssize_t | read (void *buf, size_t nbyte)=0 |
attempts to read nbyte bytes from the transport connection and writes them into the given buffer. More... | |
virtual ssize_t | write (void *buf, size_t nbyte)=0 |
attempts to write nbyte bytes from the given buffer to the transport connection. More... | |
virtual void | close ()=0 |
Closes the transport connection. More... | |
virtual unsigned long | getPeerCertificateLength ()=0 |
returns the size in bytes of the peer certificate of a secure connection. More... | |
virtual OFBool | networkDataAvailable (int timeout)=0 |
checks if data is available to be read on the transport connection. More... | |
virtual OFBool | isTransparentConnection ()=0 |
returns OFTrue if this connection is a transparent TCP connection, OFFalse if the connection is a secure connection. | |
virtual OFString & | dumpConnectionParameters (OFString &str)=0 |
dump the characteristics of the current connection More... | |
void | dumpConnectionParameters (STD_NAMESPACE ostream &out) |
prints the characteristics of the current connection on the given output stream. More... | |
virtual const char * | errorString (DcmTransportLayerStatus code)=0 |
returns an error string for a given error code. More... | |
Static Public Member Functions | |
static OFBool | selectReadableAssociation (DcmTransportConnection *connections[], int connCount, int timeout) |
indicates which of the specified transport connections is ready for reading. More... | |
Protected Member Functions | |
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... | |
Private Member Functions | |
DcmTransportConnection (const DcmTransportConnection &) | |
private undefined copy constructor | |
DcmTransportConnection & | operator= (const DcmTransportConnection &) |
private undefined assignment operator | |
Static Private Member Functions | |
static OFBool | safeSelectReadableAssociation (DcmTransportConnection *connections[], int connCount, int timeout) |
indicates which of the specified transport connections is ready for reading. More... | |
static OFBool | fastSelectReadableAssociation (DcmTransportConnection *connections[], int connCount, int timeout) |
indicates which of the specified transport connections is ready for reading. More... | |
Private Attributes | |
DcmNativeSocketType | theSocket |
the socket file descriptor/handle used by the transport connection. | |
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 | ( | DcmNativeSocketType | openSocket | ) |
constructor.
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. |
|
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.
Implemented in DcmTCPConnection, and DcmTLSConnection.
|
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 DcmTCPConnection, and DcmTLSConnection.
dump the characteristics of the current connection
str | the string to dump into |
Implemented in DcmTCPConnection, and DcmTLSConnection.
void DcmTransportConnection::dumpConnectionParameters | ( | STD_NAMESPACE ostream & | out | ) |
prints the characteristics of the current connection on the given output stream.
out | output stream |
|
pure virtual |
returns an error string for a given error code.
code | error code |
Implemented in DcmTCPConnection, and DcmTLSConnection.
|
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.
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. |
|
pure virtual |
returns the size in bytes of the peer certificate of a secure connection.
May return 0 if connection is transparent TCP/IP.
Implemented in DcmTCPConnection, and DcmTLSConnection.
|
inlineprotected |
returns the socket file descriptor managed by this object.
|
pure virtual |
checks if data is available to be read on the transport connection.
Abstract method.
timeout | maximum number of seconds to wait if no data is available. If this parameter is 0, the function does not block. |
Implemented in DcmTCPConnection, and DcmTLSConnection.
|
pure virtual |
attempts to read nbyte bytes from the transport connection and writes them into the given buffer.
Abstract method.
buf | buffer |
nbyte | number of bytes to read |
Implemented in DcmTCPConnection, and DcmTLSConnection.
|
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.
newSuite | string identifying the ciphersuite to be negotiated. |
Implemented in DcmTCPConnection, and DcmTLSConnection.
|
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.
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. |
|
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.
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. |
|
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.
Implemented in DcmTCPConnection, and DcmTLSConnection.
|
inlineprotected |
set the socket file descriptor managed by this object.
socket | file descriptor |
|
pure virtual |
attempts to write nbyte bytes from the given buffer to the transport connection.
Abstract method.
buf | buffer |
nbyte | number of bytes to write |
Implemented in DcmTCPConnection, and DcmTLSConnection.