License:
BSD style: see license.txt
Version:
Initial release: March 2004
Outback release: December 2006
author:
Kris
- class
ServerSocket
: tango.io.model.IConduit.ISelectable;
-
ServerSocket
is a wrapper upon the basic socket functionality to
simplify the API somewhat. You use a
ServerSocket
to listen for
inbound connection requests, and get back a SocketConduit when a
connection is made.
Accepted SocketConduit instances are held in a free-list to help
avoid heap activity. These instances are recycled upon invoking
the close() method, and one should ensure that occurs
- this(InternetAddress addr, int backlog = 32, bool reuse = false);
- Construct a ServerSocket on the given address, with the
specified number of backlog connections supported. The
socket is bound to the given address, and set to listen
for incoming connections. Note that the socket address
can be setup for reuse, so that a halted server may be
restarted immediately.
- Handle
fileHandle
();
- Models a handle-oriented device.
TODO:
figure out how to avoid exposing this in the general
case
- ServerSocket
setLingerPeriod
(int period);
- Set the period in which dead sockets are left lying around
by the O/S
- ServerSocket
setTimeout
(float timeout);
- Set the default read timeout to the specified interval. Set
a value of zero to disable timeout support.
The interval is in units of seconds, where 0.500 would
represent 500 milliseconds. Use TimeSpan.interval to
convert from a TimeSpan instance.
- Socket
socket
();
- Return the wrapped
socket
- bool
isAlive
();
- Is this server still alive?
- protected SocketConduit
create
();
- Produce a SocketConduit instance. This can be overridden
to return SocketConduit derivatives
- SocketConduit
accept
();
- Wait for a client to connect to us, and return a connected
SocketConduit.
|