#include <CTCPSocket.h>
Inherits IDataSocket.
Inheritance diagram for CTCPSocket:
Public Member Functions | |
CTCPSocket (CArchSocket) | |
virtual void | bind (const CNetworkAddress &) |
Bind socket to address. | |
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 read() will succeed. | |
virtual UInt32 | getSize () const |
Get bytes available to read. | |
virtual void | connect (const CNetworkAddress &) |
Connect socket. |
A data socket using TCP.
Definition at line 32 of file CTCPSocket.h.
|
Bind socket to address. Binds the socket to a particular address. Implements IDataSocket. Definition at line 72 of file CTCPSocket.cpp. References CNetworkAddress::getAddress(). |
|
Close the stream.
Closes the stream. Pending input data and buffered output data are discarded. Use Reimplemented from IDataSocket. Definition at line 86 of file CTCPSocket.cpp. References ISocket::getDisconnectedEvent(). |
|
Connect socket. 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. Implements IDataSocket. Definition at line 252 of file CTCPSocket.cpp. References CNetworkAddress::getAddress(), and IDataSocket::getConnectedEvent(). |
|
Flush the stream. Waits until all buffered data has been written to the stream. Implements IDataSocket. Definition at line 175 of file CTCPSocket.cpp. References CCondVarBase::wait(). |
|
Get event target. Returns the event target for events generated by this stream. It should be the source stream in a chain of stream filters. Reimplemented from IDataSocket. Definition at line 114 of file CTCPSocket.cpp. |
|
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. Implements IDataSocket. Definition at line 245 of file CTCPSocket.cpp. References CStreamBuffer::getSize(). |
|
Test if
Returns true iff an immediate Implements IDataSocket. Definition at line 238 of file CTCPSocket.cpp. References CStreamBuffer::getSize(). |
|
Read from stream.
Read up to Implements IDataSocket. Definition at line 120 of file CTCPSocket.cpp. References ISocket::getDisconnectedEvent(), CStreamBuffer::getSize(), CStreamBuffer::peek(), and CStreamBuffer::pop(). |
|
Shutdown input. Shutdown the input side of the stream. Any pending input data is discarded and further reads immediately return 0. Implements IDataSocket. Definition at line 184 of file CTCPSocket.cpp. References IStream::getInputShutdownEvent(). |
|
Shutdown output.
Shutdown the output side of the stream. Any buffered output data is discarded and further writes generate output error events. Use Implements IDataSocket. Definition at line 211 of file CTCPSocket.cpp. References IStream::getOutputShutdownEvent(). |
|
Write to stream.
Write Implements IDataSocket. Definition at line 143 of file CTCPSocket.cpp. References IStream::getOutputErrorEvent(), CStreamBuffer::getSize(), and CStreamBuffer::write(). |