This class implements a
standard Berkeley socket. Each
socket is constructed with the address family to use, the socket
type (datagram or stream), and the protocol that the socket
will use. Every socket must be bound to a local
endpoint before you can use it. The
that contains the local IP address and port number to bind
the socket to.
Bind() must be
called before any connection
can be made through the socket.
To establish a connection to
a remote address, use
To listen for connections from remote clients, use
Listen() to set the socket in
listening mode where it waits for incoming connections.
The integer argument to
specifies how many remote connection requests can be queued at one
time, waiting for a socket connection. A call to
returns a new socket that connects to the first pending connection
request in the listening queue. This new socket exists only
for this connection and is destroyed once the connection
Data is written to a socket using
Send(). Data from a specified
buffer is sent through the socket to its remote endpoint.
Data is read from a socket using
data from the socket connection and stores it in a specified
You can set several socket options to control the behavior
of a socket with
This method requires a
SocketOptionLevel value, which determines the type of socket option to set. For example, ...