The TCP session is used to primarily to represent a client connection that can be managed on a seperate thread.
More...
|
| | TCPSession (const IPV4Host &host, tpport_t port, size_t size=536, int pri=0, size_t stack=0) |
| | Create a TCP socket that will be connected to a remote TCP server and that will execute under it's own thread.
|
| |
|
| TCPSession (const IPV6Host &host, tpport_t port, size_t size=536, int pri=0, size_t stack=0) |
| |
| | TCPSession (TCPSocket &server, int pri=0, size_t stack=0) |
| | Create a TCP socket from a bound TCP server by accepting a pending connection from that server and execute a thread for the accepted connection.
|
| |
|
| TCPSession (TCPV6Socket &server, int pri=0, size_t stack=0) |
| |
|
virtual | ~TCPSession () |
| | Make sure destruction happens through a virtual...
|
| |
| void | connect (TCPSocket &server) |
| | Accept a connection from a TCP Server.
|
| |
|
void | connect (TCPV6Socket &server) |
| |
|
void | disconnect (void) |
| | Disconnect the current session and prepare for a new one.
|
| |
| size_t | getBufferSize (void) const |
| | Return the size of the current stream buffering used.
|
| |
|
int | getSegmentSize (void) |
| | Get protocol segment size.
|
| |
| bool | isPending (Pending pend, timeout_t timeout=ucommon::Timer::inf) |
| | Get the status of pending stream data.
|
| |
| ssize_t | peek (void *buf, size_t len) |
| | Examine contents of next waiting packet.
|
| |
| size_t | printf (const char *format,...) |
| | Print content into a socket.
|
| |
| void | setTimeout (timeout_t timer) |
| | Set the I/O operation timeout for socket I/O operations.
|
| |
| int | sync (void) |
| | Flushes the stream input and output buffers, writes pending output.
|
| |
| | TCPStream (const char *name, Family family=IPV4, unsigned mss=536, bool throwflag=false, timeout_t timer=0) |
| | Construct a named TCP Socket connected to a remote machine.
|
| |
| | TCPStream (const IPV4Host &host, tpport_t port, unsigned mss=536, bool throwflag=true, timeout_t timeout=0) |
| | Create a TCP stream by connecting to a TCP socket (on a remote machine).
|
| |
|
| TCPStream (const IPV6Host &host, tpport_t port, unsigned mss=536, bool throwflag=true, timeout_t timeout=0) |
| |
|
| TCPStream (Family family=IPV4, bool throwflag=true, timeout_t to=0) |
| | The constructor required for building other classes or to start an unconnected TCPStream for connect.
|
| |
| | TCPStream (TCPSocket &server, bool throwflag=true, timeout_t timeout=0) |
| | Create a TCP stream by accepting a connection from a bound TCP socket acting as a server.
|
| |
|
| TCPStream (TCPV6Socket &server, bool throwflag=true, timeout_t timeout=0) |
| |
|
virtual | ~TCPStream () |
| | Flush and empty all buffers, and then remove the allocated buffers.
|
| |
|
| void | initial (void) |
| | The initial method is used to esablish a connection when delayed completion is used.
|
| |
| int | waitConnection (timeout_t timeout=ucommon::Timer::inf) |
| | Normally called during the thread Initial() method by default, this will wait for the socket connection to complete when connecting to a remote socket.
|
| |
| void | allocate (size_t size) |
| | Used to allocate the buffer space needed for iostream operations.
|
| |
| void | connect (const char *name, unsigned mss=536) |
| | Connect a TCP stream to a named destination host and port number, using getaddrinfo interface if available.
|
| |
| void | connect (const IPV4Host &host, tpport_t port, unsigned mss=536) |
| | Create a TCP stream by connecting to a TCP socket (on a remote machine).
|
| |
|
void | connect (const IPV6Host &host, tpport_t port, unsigned mss=536) |
| |
| void | endStream (void) |
| | Used to terminate the buffer space and cleanup the socket connection.
|
| |
| int | overflow (int ch) |
| | This streambuf method is used to write the output buffer through the established tcp connection.
|
| |
| std::iostream * | tcp (void) |
| | Used in derived classes to refer to the current object via it's iostream.
|
| |
| int | uflow () |
| | This streambuf method is used for doing unbuffered reads through the establish tcp socket connection when in interactive mode.
|
| |
| int | underflow () |
| | This streambuf method is used to load the input buffer through the established tcp socket connection.
|
| |
The TCP session is used to primarily to represent a client connection that can be managed on a seperate thread.
The TCP session also supports a non-blocking connection scheme which prevents blocking during the constructor and moving the process of completing a connection into the thread that executes for the session.
- Author
- David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m
Threaded streamable socket with non-blocking constructor.
Definition at line 564 of file tcp.h.