JanosVM v0.6.0 Java API Documentation: Class TCPChannel
edu.utah.janosvm.kit.comm.jsi
Class TCPChannel
java.lang.Object
|
+--edu.utah.janosvm.kit.comm.jsi.TCPChannel
public final class TCPChannel extends java.lang.Objectimplements JSIChannel
A straight forward TCP implementation of a JSIChannel.
Constructor Summary
TCPChannel (java.lang.String host,
int port)
Construct a TCPChannel thats connected to the given host/port.
Method Summary
void
disconnect ()
Disconnect the channel from its peer.
byte[]
recvMessage ()
Receive a flattened message from the peer.
void
replyMessage (byte[] msg)
Send a reply message to the peer.
void
sendMessage (byte[] msg)
Send a message to the peer.
java.lang.String
toString ()
Methods inherited from class java.lang.Object
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait
TCPChannel
public TCPChannel (java.lang.String host,
int port)
throws java.net.UnknownHostException,
java.io.IOException
Construct a TCPChannel thats connected to the given host/port.
Parameters: host
- The host to connect to.port
- The port the provider is listening on.
disconnect
public void disconnect ()
Description copied from interface: JSIChannel
Disconnect the channel from its peer.
Specified by: disconnect in interface JSIChannel
sendMessage
public void sendMessage (byte[] msg)
throws java.io.IOException
Description copied from interface: JSIChannel
Send a message to the peer.
Specified by: sendMessage in interface JSIChannel
Tags copied from interface: JSIChannel
Parameters: msg
- A flattened JSI message.Throws: Throws - an IOException if something went wrong.
replyMessage
public void replyMessage (byte[] msg)
throws java.io.IOException
Description copied from interface: JSIChannel
Send a reply message to the peer.
Specified by: replyMessage in interface JSIChannel
Tags copied from interface: JSIChannel
Parameters: msg
- A flattened JSI message.Throws: Throws - an IOException if something went wrong.
recvMessage
public byte[] recvMessage ()
throws java.io.IOException
Description copied from interface: JSIChannel
Receive a flattened message from the peer.
Specified by: recvMessage in interface JSIChannel
Tags copied from interface: JSIChannel
Returns: The flattened message or null if the channel is no longer
connected. Throws: Throws - an IOException if something went wrong.
toString
public java.lang.String toString ()
Overrides: toString in class java.lang.Object
This documentation is Copyright (C) 2000-2002 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions. Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/ Generated on Mar 17, 2002