.TH "ost::TCPV6Socket" 3 "Sun Dec 27 2020" "GNU CommonC++" \" -*- nroff -*- .ad l .nh .SH NAME ost::TCPV6Socket \- TCPV6 sockets are used for stream based connected sessions between two ipv6 sockets\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBost::Socket\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual bool \fBonAccept\fP (const \fBIPV6Host\fP &ia, \fBtpport_t\fP port)" .br .RI "A method to call in a derived \fBTCPSocket\fP class that is acting as a server when a connection request is being accepted\&. " .ti -1c .RI "\fBSOCKET\fP \fBgetSocket\fP (void)" .br .RI "Fetch out the socket\&. " .ti -1c .RI "int \fBgetSegmentSize\fP (void)" .br .ti -1c .RI "\fBTCPV6Socket\fP (const \fBIPV6Address\fP &bind, \fBtpport_t\fP port, unsigned backlog=5, unsigned mss=536)" .br .RI "A TCP 'server' is created as a TCP socket that is bound to a hardware address and port number on the local machine and that has a backlog queue to listen for remote connection requests\&. " .ti -1c .RI "\fBTCPV6Socket\fP (const char *name, unsigned backlog=5, unsigned mss=536)" .br .RI "Create a TCP server for a named host interface and service port\&. " .ti -1c .RI "\fBIPV6Host\fP \fBgetRequest\fP (\fBtpport_t\fP *port=NULL) const" .br .RI "Return address and port of next connection request\&. " .ti -1c .RI "void \fBreject\fP (void)" .br .RI "Used to reject the next incoming connection request\&. " .ti -1c .RI "\fBIPV6Host\fP \fBgetLocal\fP (\fBtpport_t\fP *port=NULL) const" .br .RI "Used to get local bound address\&. " .ti -1c .RI "bool \fBisPendingConnection\fP (\fBtimeout_t\fP timeout=\fBTIMEOUT_INF\fP)" .br .RI "Used to wait for pending connection requests\&. " .ti -1c .RI "virtual \fB~TCPV6Socket\fP ()" .br .RI "Use base socket handler for ending this socket\&. " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP TCPV6 sockets are used for stream based connected sessions between two ipv6 sockets\&. Both error recovery and flow control operate transparently for a TCP socket connection\&. The TCP socket base class is primary used to bind a TCP 'server' for accepting TCP streams\&. .PP An implicit and unique \fBTCPV6Socket\fP object exists in Common C++ to represent a bound ipv6 TCP socket acting as a 'server' for receiving connection requests\&. This class is not part of \fBTCPStream\fP because such objects normally perform no physical I/O (read or write operations) other than to specify a listen backlog queue and perform 'accept' operations for pending connections\&. The Common C++ \fBTCPV6Socket\fP offers a Peek method to examine where the next pending connection is coming from, and a Reject method to flush the next request from the queue without having to create a session\&. .PP The \fBTCPV6Socket\fP also supports a 'OnAccept' method which can be called when a \fBTCPStream\fP related object is created from a \fBTCPSocket\fP\&. By creating a \fBTCPStream\fP from a \fBTCPV6Socket\fP, an accept operation automatically occurs, and the \fBTCPV6Socket\fP can then still reject the client connection through the return status of it's OnAccept method\&. .PP \fBAuthor\fP .RS 4 David Sugar dyfet@tycho.com .RE .PP bound server for TCP streams and sessions\&. .SH "Constructor & Destructor Documentation" .PP .SS "ost::TCPV6Socket::TCPV6Socket (const \fBIPV6Address\fP & bind, \fBtpport_t\fP port, unsigned backlog = \fC5\fP, unsigned mss = \fC536\fP)" .PP A TCP 'server' is created as a TCP socket that is bound to a hardware address and port number on the local machine and that has a backlog queue to listen for remote connection requests\&. If the server cannot be created, an exception is thrown\&. .PP \fBParameters\fP .RS 4 \fIbind\fP local ip address or interface to use\&. .br \fIport\fP number to bind socket under\&. .br \fIbacklog\fP size of connection request queue\&. .br \fImss\fP maximum segment size of streaming buffer\&. .RE .PP .SS "ost::TCPV6Socket::TCPV6Socket (const char * name, unsigned backlog = \fC5\fP, unsigned mss = \fC536\fP)" .PP Create a TCP server for a named host interface and service port\&. We use [host/]port for specifying the optional host name and service port since ':' is a valid char for ipv6 addresses\&. .PP \fBParameters\fP .RS 4 \fIname\fP of host interface and service to use\&. .br \fIbacklog\fP size of connection request queue\&. .br \fImss\fP maximum segment size of streaming buffers\&. .RE .PP .SS "virtual ost::TCPV6Socket::~TCPV6Socket ()\fC [virtual]\fP" .PP Use base socket handler for ending this socket\&. .SH "Member Function Documentation" .PP .SS "\fBIPV6Host\fP ost::TCPV6Socket::getLocal (\fBtpport_t\fP * port = \fCNULL\fP) const\fC [inline]\fP" .PP Used to get local bound address\&. .PP References ost::Socket::getIPV6Local()\&. .SS "\fBIPV6Host\fP ost::TCPV6Socket::getRequest (\fBtpport_t\fP * port = \fCNULL\fP) const\fC [inline]\fP" .PP Return address and port of next connection request\&. This can be used instead of OnAccept() to pre-evaluate connection requests\&. .PP \fBReturns\fP .RS 4 host requesting a connection\&. .RE .PP \fBParameters\fP .RS 4 \fIport\fP number of requestor\&. .RE .PP .PP References ost::Socket::getIPV6Sender()\&. .SS "int ost::TCPV6Socket::getSegmentSize (void)\fC [inline]\fP" .SS "\fBSOCKET\fP ost::TCPV6Socket::getSocket (void)\fC [inline]\fP" .PP Fetch out the socket\&. .SS "bool ost::TCPV6Socket::isPendingConnection (\fBtimeout_t\fP timeout = \fC\fBTIMEOUT_INF\fP\fP)\fC [inline]\fP" .PP Used to wait for pending connection requests\&. .PP \fBReturns\fP .RS 4 true if data packets available\&. .RE .PP \fBParameters\fP .RS 4 \fItimeout\fP in milliseconds\&. TIMEOUT_INF if not specified\&. .RE .PP .PP References ost::Socket::isPending(), and ost::Socket::pendingInput\&. .SS "virtual bool ost::TCPV6Socket::onAccept (const \fBIPV6Host\fP & ia, \fBtpport_t\fP port)\fC [virtual]\fP" .PP A method to call in a derived \fBTCPSocket\fP class that is acting as a server when a connection request is being accepted\&. The server can implement protocol specific rules to exclude the remote socket from being accepted by returning false\&. The Peek method can also be used for this purpose\&. .PP \fBReturns\fP .RS 4 true if client should be accepted\&. .RE .PP \fBParameters\fP .RS 4 \fIia\fP internet host address of the client\&. .br \fIport\fP number of the client\&. .RE .PP .SS "void ost::TCPV6Socket::reject (void)" .PP Used to reject the next incoming connection request\&. .SH "Author" .PP Generated automatically by Doxygen for GNU CommonC++ from the source code\&.