sdsu.net
Class XorServerSocket
java.lang.Object
|
+--java.net.ServerSocket
|
+--sdsu.net.XorServerSocket
- public class XorServerSocket
- extends java.net.ServerSocket
Constructor Summary |
XorServerSocket(int port,
byte mask)
Creates a server socket on a specified port. |
XorServerSocket(int port,
int backlog,
byte mask)
Creates a server socket on a specified port. |
XorServerSocket(int port,
int backlog,
java.net.InetAddress bindAddress,
byte mask)
Create a server with the specified port, listen backlog, and
local IP address to bind to. |
Method Summary |
java.net.Socket |
accept()
Listens for a connection to be made to this socket and accepts
it. |
Methods inherited from class java.net.ServerSocket |
close,
getInetAddress,
getLocalPort,
getSoTimeout,
setSocketFactory,
setSoTimeout,
toString |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
XorServerSocket
public XorServerSocket(int port,
byte mask)
throws java.io.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:
- java.io.IOException - if an I/O error occurs when opening the
socket.
XorServerSocket
public XorServerSocket(int port,
int backlog,
byte mask)
throws java.io.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:
- java.io.IOException - if an I/O error occurs when opening
the socket.
XorServerSocket
public XorServerSocket(int port,
int backlog,
java.net.InetAddress bindAddress,
byte mask)
throws java.io.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 portbacklog
- the listen backlogbindAddr
- the local InetAddress the server will bind tomask
- byte mask with which all input/output bytes
are Xor'ed
accept
public java.net.Socket accept()
throws java.io.IOException
- Listens for a connection to be made to this socket and accepts
it. The method blocks until a connection is made.
- Throws:
- java.io.IOException - if an I/O error occurs when waiting for a
connection.
- Overrides:
- accept in class java.net.ServerSocket