Package edu.jas.util
Class SocketChannel
java.lang.Object
edu.jas.util.SocketChannel
SocketChannel provides a communication channel for Java objects using TCP/IP
sockets. Refactored for java.util.concurrent.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ObjectInputStream
private final ObjectOutputStream
private final Socket
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
in
-
out
-
soc
-
-
Constructor Details
-
SocketChannel
Constructs a socket channel on the given socket s.- Parameters:
s
- A socket object.- Throws:
IOException
-
-
Method Details
-
getSocket
Get the Socket -
send
Sends an object- Throws:
IOException
-
receive
Receives an object- Throws:
IOException
ClassNotFoundException
-
close
public void close()Closes the channel. -
toString
to string
-