net.sf.neem.impl
Class Connection

java.lang.Object
  extended by net.sf.neem.impl.Handler
      extended by net.sf.neem.impl.Connection

public class Connection
extends Handler

Connection with a peer. This class provides event handlers for a connection. It also implements multiplexing and queuing.


Field Summary
 java.util.UUID id
          Used by overlay management to assign an unique id to the remote process.
 java.net.InetSocketAddress listen
          Used by overlay management to keep the socket where this peer can be contacted.
 Queue queue
          Message queue
protected  java.nio.channels.SocketChannel sock
           
 
Fields inherited from class net.sf.neem.impl.Handler
logger, transport
 
Method Summary
 java.net.InetSocketAddress getPeer()
           
 java.net.InetAddress getRemoteAddress()
           
 void send(java.nio.ByteBuffer[] msg, short port)
          Send message to peers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sock

protected java.nio.channels.SocketChannel sock

queue

public Queue queue
Message queue


id

public java.util.UUID id
Used by overlay management to assign an unique id to the remote process.


listen

public java.net.InetSocketAddress listen
Used by overlay management to keep the socket where this peer can be contacted.

Method Detail

send

public void send(java.nio.ByteBuffer[] msg,
                 short port)
Send message to peers

Parameters:
msg - The message to be sent.
port - Port, at transport layer, where the message must be delivered.

getPeer

public java.net.InetSocketAddress getPeer()

getRemoteAddress

public java.net.InetAddress getRemoteAddress()


Copyright © 2005 University of Minho, Portugal. All Rights Reserved.