#include <socket.h>
Inheritance diagram for SocketPort::
Public Methods | |
void | setTimer (timeout_t timeout=0) |
Derived setTimer to notify the service thread pool of change in expected timeout. More... | |
void | incTimer (timeout_t timeout) |
Derived incTimer to notify the service thread pool of a change in expected timeout. More... | |
Protected Methods | |
SocketPort (SocketService *svc, TCPSocket &tcp) | |
Construct an accepted TCP socket connection from a specific bound TCP server. More... | |
SocketPort (SocketService *svc, const InetAddress &ia, tpport_t port) | |
Construct a bound UDP socket for use in deriving realtime UDP streaming protocols handled by thread pool objects. More... | |
void | Attach (SocketService *svc) |
Attach yourself to the service pool thread object. More... | |
virtual | ~SocketPort () |
Disconnect the socket from the service thread pool and the remote connection. More... | |
void | setDetectPending (bool) |
Used to indicate if the service thread should monitor pending data for us. More... | |
bool | getDetectPending (void) const |
Get the current state of the DetectPending flag. More... | |
void | setDetectOutput (bool) |
Used to indicate if output ready monitoring should be performed by the service thread. More... | |
bool | getDetectOutput (void) const |
Get the current state of the DetectOutput flag. More... | |
virtual void | Expired (void) |
Called by the service thread pool when the objects timer has expired. More... | |
virtual void | Pending (void) |
Called by the service thread pool when input data is pending for this socket. More... | |
virtual void | Output (void) |
Called by the service thread pool when output data is pending for this socket. More... | |
virtual void | Disconnect (void) |
Called by the service thread pool when a disconnect has occured. More... | |
sockerror_t | Connect (const InetAddress &ia, tpport_t port) |
Connect a Socket Port to a known peer host. More... | |
int | Send (void *buf, int len) |
Transmit "send" data to a connected peer host. More... | |
int | Recv (void *buf, size_t len) |
Receive a message from any host. More... | |
int | Peek (void *buf, size_t len) |
Examine the content of the next packet. More... | |
Friends | |
class | SocketService |
Derived versions of this class offer specific functionality for specific protocols. Both Common C++ supporting frameworks and application objects may be derived from related protocol specific base classes.
A special set of classes, "SocketPort" and "SocketService", exist for building realtime streaming media servers on top of UDP and TCP protocols. The "SocketPort" is used to hold a connected or associated TCP or UDP socket which is being "streamed" and which offers callback methods that are invoked from a "SocketService" thread. SocketService's can be pooled into logical thread pools that can service a group of SocketPorts. A millisecond accurate "timer" is associated with each SocketPort and can be used to time synchronize SocketPort I/O operations.
|
Construct an accepted TCP socket connection from a specific bound TCP server. This is meant to derive advanced application specific TCP servers that can be thread pooled.
|
|
Construct a bound UDP socket for use in deriving realtime UDP streaming protocols handled by thread pool objects.
|
|
Disconnect the socket from the service thread pool and the remote connection.
|
|
Attach yourself to the service pool thread object. The later version.
|
|
Connect a Socket Port to a known peer host. This is normally used with the UDP constructor. This is also performed as a non-blocking operation under Posix systems to prevent delays in a callback handler.
|
|
Called by the service thread pool when a disconnect has occured.
|
|
Called by the service thread pool when the objects timer has expired. Used for timed events. |
|
Called by the service thread pool when output data is pending for this socket.
|
|
Examine the content of the next packet. This can be used to build "smart" line buffering for derived TCP classes.
|
|
Called by the service thread pool when input data is pending for this socket.
|
|
Receive a message from any host. This is used in derived classes to build protocols.
|
|
Transmit "send" data to a connected peer host. This is not public by default since an overriding protocol is likely to be used in a derived class.
|
|
Get the current state of the DetectOutput flag.
|
|
Get the current state of the DetectPending flag.
|
|
Derived incTimer to notify the service thread pool of a change in expected timeout. This allows SocketService to reschedule all timers. Otherwise same as TimerPort.
Reimplemented from TimerPort. |
|
Used to indicate if output ready monitoring should be performed by the service thread.
|
|
Used to indicate if the service thread should monitor pending data for us.
|
|
Derived setTimer to notify the service thread pool of change in expected timeout. This allows SocketService to reschedule all timers. Otherwise same as TimerPort.
Reimplemented from TimerPort. |
|
|