#include <IDataSocket.h>
Inherits ISocket, and IStream.
Inherited by CTCPSocket.
Inheritance diagram for IDataSocket:
Public Member Functions | |
virtual void | bind (const CNetworkAddress &)=0 |
Bind socket to address. | |
virtual void | close () |
Close the stream. | |
virtual void * | getEventTarget () const |
Get event target. | |
virtual UInt32 | read (void *buffer, UInt32 n)=0 |
Read from stream. | |
virtual void | write (const void *buffer, UInt32 n)=0 |
Write to stream. | |
virtual void | flush ()=0 |
Flush the stream. | |
virtual void | shutdownInput ()=0 |
Shutdown input. | |
virtual void | shutdownOutput ()=0 |
Shutdown output. | |
virtual bool | isReady () const =0 |
Test if read() will succeed. | |
virtual UInt32 | getSize () const =0 |
Get bytes available to read. | |
manipulators | |
virtual void | connect (const CNetworkAddress &)=0 |
Connect socket. | |
Static Public Member Functions | |
accessors | |
CEvent::Type | getConnectedEvent () |
Get connected event type. | |
CEvent::Type | getConnectionFailedEvent () |
Get connection failed event type. |
This interface defines the methods common to all network sockets that represent a full-duplex data stream.
Definition at line 26 of file IDataSocket.h.
|
Bind socket to address. Binds the socket to a particular address. Implements ISocket. Implemented in CTCPSocket. |
|
Close the stream.
Closes the stream. Pending input data and buffered output data are discarded. Use Implements IStream. Reimplemented in CTCPSocket. Definition at line 39 of file IDataSocket.cpp. |
|
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. Implemented in CTCPSocket. Referenced by CClient::connect(). |
|
Flush the stream. Waits until all buffered data has been written to the stream. Implements IStream. Implemented in CTCPSocket. |
|
Get connected event type. Returns the socket connected event type. A socket sends this event when a remote connection has been established. Definition at line 25 of file IDataSocket.cpp. References CEvent::registerTypeOnce(). Referenced by CTCPSocket::connect(). |
|
Get connection failed event type. Returns the socket connection failed event type. A socket sends this event when an attempt to connect to a remote port has failed. The data is a pointer to a CConnectionFailedInfo. Definition at line 32 of file IDataSocket.cpp. References CEvent::registerTypeOnce(). |
|
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. Implements IStream. Reimplemented in CTCPSocket. Definition at line 46 of file IDataSocket.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 IStream. Implemented in CTCPSocket. |
|
Test if
Returns true iff an immediate Implements IStream. Implemented in CTCPSocket. |
|
Read from stream.
Read up to Implements IStream. Implemented in CTCPSocket. |
|
Shutdown input. Shutdown the input side of the stream. Any pending input data is discarded and further reads immediately return 0. Implements IStream. Implemented in CTCPSocket. |
|
Shutdown output.
Shutdown the output side of the stream. Any buffered output data is discarded and further writes generate output error events. Use Implements IStream. Implemented in CTCPSocket. |
|
Write to stream.
Write Implements IStream. Implemented in CTCPSocket. |