|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.net.Socket | +--sdsu.net.XorSocket
This class implements client sockets (also called just "sockets"). A socket is an endpoint for communication between two machines. Each input and output byte is Xor'ed with the byte mask provided in the constructor. This provides a very weak form of encryption.
Socket
Constructor Summary | |
XorSocket(byte mask)
Creates an unconnected socket. |
|
XorSocket(java.net.InetAddress address,
int port,
byte mask)
Creates a stream socket and connects it to the specified port number at the specified IP address. |
|
XorSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddr,
int localPort,
byte mask)
Creates a socket and connects it to the specified remote address on the specified remote port. |
|
XorSocket(java.lang.String host,
int port,
byte mask)
Constructor for class XorSocket. |
|
XorSocket(java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort,
byte mask)
Creates a socket and connects it to the specified remote host on the specified remote port. |
Method Summary | |
void |
close()
|
java.io.InputStream |
getInputStream()
Returns an inputstream on the socket. |
java.io.OutputStream |
getOutputStream()
Returns an outputstream on the socket. |
Methods inherited from class java.net.Socket |
getInetAddress,
getLocalAddress,
getLocalPort,
getPort,
getReceiveBufferSize,
getSendBufferSize,
getSoLinger,
getSoTimeout,
getTcpNoDelay,
setReceiveBufferSize,
setSendBufferSize,
setSocketImplFactory,
setSoLinger,
setSoTimeout,
setTcpNoDelay,
toString |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public XorSocket(byte mask) throws java.io.IOException
mask
- byte mask with which all input/output bytes
are Xor'edpublic XorSocket(java.lang.String host, int port, byte mask) throws java.io.IOException
host
- the remote machine to connect toport
- the remote TCP portmask
- byte mask with which all input/output bytes
are Xor'edpublic XorSocket(java.net.InetAddress address, int port, byte mask) throws java.io.IOException
address
- the IP address.port
- the port number.mask
- byte mask with which all input/output bytes
are Xor'edpublic XorSocket(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort, byte mask) throws java.io.IOException
host
- the name of the remote hostport
- the remote portlocalAddr
- the local address the socket is bound tolocalPort
- the local port the socket is bound tomask
- byte mask with which all input/output bytes
are Xor'edpublic XorSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort, byte mask) throws java.io.IOException
address
- the remote addressport
- the remote portlocalAddr
- the local address the socket is bound tolocalPort
- the local port the socket is bound tomask
- byte mask with which all input/output bytes
are Xor'edMethod Detail |
public java.io.InputStream getInputStream() throws java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException
public void close() throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |