All Packages Class Hierarchy This Package Previous Next Index
Class sdsu.net.XorServerSocket
java.lang.Object
|
+----java.net.ServerSocket
|
+----sdsu.net.XorServerSocket
- public class XorServerSocket
- extends ServerSocket
-
XorServerSocket(int, byte)
- Creates a server socket on a specified port.
-
XorServerSocket(int, int, byte)
- Creates a server socket on a specified port.
-
XorServerSocket(int, int, InetAddress, byte)
-
Create a server with the specified port, listen backlog, and
local IP address to bind to.
-
accept()
- Listens for a connection to be made to this socket and accepts
it.
XorServerSocket
public XorServerSocket(int port,
byte mask) throws IOException
- Creates a server socket on a specified port. A port of
0
creates a socket on any free port.
The maximum queue length for incoming connection indications (a
request to connect) is set to 50
. If a connection
indication arrives when the queue is full, the connection is refused.
- Parameters:
- port - the port number, or
0
to use any
free port.
- mask - byte mask with which all input/output bytes are
Xor'ed
- Throws: IOException
- if an I/O error occurs when opening the
socket.
XorServerSocket
public XorServerSocket(int port,
int backlog,
byte mask) throws IOException
- Creates a server socket on a specified port. A port of
0
creates a socket on any free port.
The maximum queue length for incoming connection indications (a
request to connect) is set to the count
parameter. If
a connection indication arrives when the queue is full, the
connection is refused.
- Parameters:
- port - the port number, or
0
to use any
free port.
- backlog - the maximum length of the queue.
- mask - byte mask with which all input/output bytes
are Xor'ed
- Throws: IOException
- if an I/O error occurs when opening
the socket.
XorServerSocket
public XorServerSocket(int port,
int backlog,
InetAddress bindAddress,
byte mask) throws IOException
- Create a server with the specified port, listen backlog, and
local IP address to bind to. The bindAddr argument
can be used on a multi-homed host for a ServerSocket that
will only accept connect requests to one of its addresses.
If bindAddr is null, it will default accepting
connections on any/all local addresses.
The port must be between 0 and 65535, inclusive.
- Parameters:
- port - the local TCP port
- backlog - the listen backlog
- bindAddr - the local InetAddress the server will bind to
- mask - byte mask with which all input/output bytes
are Xor'ed
accept
public Socket accept() throws IOException
- Listens for a connection to be made to this socket and accepts
it. The method blocks until a connection is made.
- Throws: IOException
- if an I/O error occurs when waiting for a
connection.
- Overrides:
- accept in class ServerSocket
All Packages Class Hierarchy This Package Previous Next Index