Package edu.jas.util
Class SocketChannel
- java.lang.Object
-
- edu.jas.util.SocketChannel
-
public class SocketChannel extends java.lang.Object
SocketChannel provides a communication channel for Java objects using TCP/IP sockets. Refactored for java.util.concurrent.- Author:
- Akitoshi Yoshida, Heinz Kredel
-
-
Constructor Summary
Constructors Constructor Description SocketChannel(java.net.Socket s)
Constructs a socket channel on the given socket s.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the channel.java.net.Socket
getSocket()
Get the Socketjava.lang.Object
receive()
Receives an objectvoid
send(java.lang.Object v)
Sends an objectjava.lang.String
toString()
to string
-
-
-
Constructor Detail
-
SocketChannel
public SocketChannel(java.net.Socket s) throws java.io.IOException
Constructs a socket channel on the given socket s.- Parameters:
s
- A socket object.- Throws:
java.io.IOException
-
-
Method Detail
-
getSocket
public java.net.Socket getSocket()
Get the Socket
-
send
public void send(java.lang.Object v) throws java.io.IOException
Sends an object- Throws:
java.io.IOException
-
receive
public java.lang.Object receive() throws java.io.IOException, java.lang.ClassNotFoundException
Receives an object- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
close
public void close()
Closes the channel.
-
toString
public java.lang.String toString()
to string- Overrides:
toString
in classjava.lang.Object
-
-