[APE Index] [APE Hierarchy] [Headers]
reliable connected TCP stream sockets. More...
#include <socket.h>
Inherits: Socket
TCP sockets are used for stream based connected sessions between two sockets. Both error recovery and flow control operate transparently for a TCP socket connection.
[public]
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.
backlog | size of connection request queue. |
port | number to bind socket under. |
bind | local ip address or interface to use. |
[public]
Create and connect a TCP socket to a bound TCP "server" on a specified host bound to a specified port number. If the socket cannot be connected, an exception is thrown.
port | number on the host to connect through. |
host | address of internet host to connect with. |
[public]
Create a TCP socket that is an "accepted" client connection from a TCP socket that has been bound as a server. This new socket is directly connected to the remote socket that had made a connection "request" into the servers backlog queue and can be thought of as being the APE method of performing an "accept()" call.
server | socket to accept connection from. |
[public]
Alternately create a TCP socket that is "accepted" from a casted pointer to a TCPSocket derived object acting as a bound TCP server. This new socket is directly connected to the remote socket that had made a connection "request" into the servers backlog queue.
server | pointer to accept connection from. |
[public]
Create an unconnected TCP socket. Mostly for internal use.
[public virtual]
A method to call in a derived TCPSocket 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.
ia | internet host address of the client. |
port | number of the client. |
[public]
Many TCP protocols involve the use of line oriented commands and data. The TCP readline method provides a very effecient means to read a single line of input from a TCP socket. This method does not use external buffering and is presumed safe from buffer overruns.
@len maximum number of bytes to read.
buf | pointer to buffer. |
[public]
Get the local socket address and port that the current socket has been bound to.
port | pointer to store the port number socket uses. |
[public]
Get the socket address of the remote socket that this socket is currently connected to.
port | pointer to store the port number of the remote socket. |
| Kdoc |