ost::SimpleTCPStream(3) | Library Functions Manual | ost::SimpleTCPStream(3) |
ost::SimpleTCPStream - Simple TCP Stream, to be used with Common C++ Library.
#include <socket.h>
Inherits ost::Socket.
SimpleTCPStream (TCPSocket &server, size_t
size=512)
Create a TCP stream by accepting a connection from a bound TCP socket acting
as a server. SimpleTCPStream (const IPV4Host &host,
tpport_t port, size_t size=512)
Create a TCP stream by connecting to a TCP socket (on a remote machine).
SimpleTCPStream (const SimpleTCPStream &source)
A copy constructor creates a new stream buffer. virtual
~SimpleTCPStream ()
Flush and empty all buffers, and then remove the allocated buffers. bool
isPending (Pending pend, timeout_t
timeout=TIMEOUT_INF)
Get the status of pending stream data. void flush ()
ssize_t read (char *bytes, size_t length, timeout_t timeout=0)
Read bytes into a buffer. ssize_t write (const char *bytes, size_t
length, timeout_t timeout=0)
Write bytes to buffer. ssize_t peek (char *bytes, size_t length,
timeout_t timeout=0)
Peek at the incoming data.
SimpleTCPStream ()
The constructor required for 'SimpleTCPStream', a more C++ style version of
the SimpleTCPStream class. void endStream (void)
Used to terminate the buffer space and cleanup the socket connection. void
Connect (const IPV4Host &host, tpport_t port,
size_t size)
Create a TCP stream by connecting to a TCP socket (on a remote machine).
Simple TCP Stream, to be used with Common C++ Library.
This source is derived from a proposal made by Ville Vainio (vvainio@tp.spt.fi).
Author:
Date:
The constructor required for 'SimpleTCPStream', a more C++ style version of the SimpleTCPStream class.
Create a TCP stream by accepting a connection from a bound TCP socket acting as a server. This performs an 'accept' call.
Parameters:
Create a TCP stream by connecting to a TCP socket (on a remote machine).
Parameters:
A copy constructor creates a new stream buffer.
Parameters:
Flush and empty all buffers, and then remove the allocated buffers.
Create a TCP stream by connecting to a TCP socket (on a remote machine).
Parameters:
Used to terminate the buffer space and cleanup the socket connection. This fucntion is called by the destructor.
References __EXPORT.
Get the status of pending stream data. This method can be used to examine if input or output is waiting, or if an error or disconnect has occured on the stream. If a read buffer contains data then input is ready. If write buffer contains data, it is first flushed and then checked.
Parameters:
Reimplemented from ost::Socket.
Peek at the incoming data. The data is copied into the buffer but is not removed from the input queue. The function then returns the number of bytes currently pending to receive.
Parameters:
Returns:
Read bytes into a buffer. <long-description>
Parameters:
Returns:
Write bytes to buffer. <long-description>
Parameters:
Returns:
Generated automatically by Doxygen for GNU CommonC++ from the source code.
Wed Oct 31 2018 | GNU CommonC++ |