uka.gm
Class GMServer.Connection
java.lang.Object
uka.gm.GMServer.Connection
- Enclosing class:
- GMServer
- public static final class GMServer.Connection
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
vport
private final GM.VPort vport
toNode
private final int toNode
toVPort
private final int toVPort
in
private GMServer.Connection.Input in
out
private GMServer.Connection.Output out
GMServer.Connection
GMServer.Connection(int toNode,
int toVPort,
GM.VPort vport)
- See Also:
GMServer#connect(int, int)
getUID
public GM.UID getUID()
getNodeVPortNr
public int getNodeVPortNr()
getPeerUID
public GM.UID getPeerUID()
getPeerVPortNr
public int getPeerVPortNr()
internalGetVPort
public GM.VPort internalGetVPort()
send
public final void send(byte[] buffer,
int offset,
int length)
throws java.io.IOException
- Throws:
java.io.IOException
receive
public final int receive(byte[] buffer,
int offset,
int length)
throws java.io.IOException
- Throws:
java.io.IOException
close
public final void close()
throws java.io.IOException
- Throws:
java.io.IOException
getOutputStream
public java.io.OutputStream getOutputStream()
- Note: The streams returned by
getInputStream() and
getOutputStream() do not conform exactly to
the specification of Java streams. The stream layer is
implemented only as method name conversion layer over the
GM message passing library therefore some restrictions
apply to the streams:
- the methods passing only a single byte
write(byte b) and int read()
are not implemented and throw an
UnsupportedOperationException. The reason is that the
Connection is not buffered and these methods can not
be implemented efficiently.
- The size of a message written in a call to
write() must always fit in the buffer
provided to the corresponding read()
call.
- There is no end-of-stream detection. Closing the
Connection on the sender side does not notify the
receiver of the end of stream condition. The
application always must close the connection on both
ends after the last write/read pair.
getInputStream
public java.io.InputStream getInputStream()
- See Also:
getOutputStream()