TCP data socket. More...
|virtual void||bind (const CNetworkAddress &)|
|virtual void||close ()|
|Close the stream. |
|virtual void *||getEventTarget () const|
|Get event target. |
|virtual UInt32||read (void *buffer, UInt32 n)|
|Read from stream. |
|virtual void||write (const void *buffer, UInt32 n)|
|Write to stream. |
|virtual void||flush ()|
|Flush the stream. |
|virtual void||shutdownInput ()|
|Shutdown input. |
|virtual void||shutdownOutput ()|
|Shutdown output. |
|virtual bool||isReady () const|
|Test if |
|virtual UInt32||getSize () const|
|Get bytes available to read. |
|virtual void||connect (const CNetworkAddress &)|
|Connect socket. |
TCP data socket.
A data socket using TCP.
Close the stream.
Closes the stream. Pending input data and buffered output data are discarded. Use
close() to send buffered output data. Attempts to
read() after a close return 0, attempts to
write() generate output error events, and attempts to
flush() return immediately.
Reimplemented from IDataSocket.
|void CTCPSocket::connect||(||const CNetworkAddress &||)||
Attempt to connect to a remote endpoint. This returns immediately and sends a connected event when successful or a connection failed event when it fails. The stream acts as if shutdown for input and output until the stream connects.
Referenced by CIpcClient::connect().
|void * CTCPSocket::getEventTarget||(||)|| const
|UInt32 CTCPSocket::getSize||(||)|| const
Get bytes available to read.
Returns a conservative estimate of the available bytes to read (i.e. a number not greater than the actual number of bytes). Some streams may not be able to determine this and will always return zero.
|bool CTCPSocket::isReady||(||)|| const
|UInt32 CTCPSocket::read||(||void *||buffer,|
Read from stream.
Read up to
n bytes into
buffer, returning the number read (zero if no data is available or input is shutdown).
buffer may be NULL in which case the data is discarded.
|void CTCPSocket::write||(||const void *||buffer,|
Write to stream.
n bytes from
buffer to the stream. If this can't complete immediately it will block. Data may be buffered in order to return more quickly. A output error event is generated when writing fails.