Search in sources :

Example 1 with ASendingConnectListener

use of sessionport.datacomm.duplex.buffer.ASendingConnectListener in project GIPC by pdewan.

the class ABufferDuplexSessionPortLauncher method launchSessionPartipant.

public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aJoinChoice) {
    // Tracer.showInfo(true);
    DuplexSessionPort<ByteBuffer> sessionPort = BufferDuplexSessionPortSelector.createBufferDuplexSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, ParticipantChoice.MEMBER);
    // DuplexServerInputPort<ByteBuffer> sessionPort =	new ADuplexBufferSessionPortFullP2P("localhost",
    // "" + ASessionsServer.SESSION_SERVER_PORT, ASessionsServer.SESSION_SERVER_NAME, "Test Session", anId, aName);
    // PrintingReplyingReceiveListener printingReplyingReceiveListener = new PrintingReplyingReceiveListener(sessionPort);
    ConnectionListener connectListener = new ASendingConnectListener(sessionPort);
    // sessionPort.addConnectListener(printingReplyingReceiveListener);
    sessionPort.addConnectionListener(connectListener);
    sessionPort.addReceiveListener(new ABufferDuplexReceiveListener());
    // serverInputPort.addDisconnectListener(echoingReceiveListener);
    // sessionPort.addReceiveListener(printingReplyingReceiveListener);
    sessionPort.connect();
}
Also used : ABufferDuplexReceiveListener(sessionport.datacomm.duplex.buffer.ABufferDuplexReceiveListener) ConnectionListener(inputport.ConnectionListener) ByteBuffer(java.nio.ByteBuffer) ASendingConnectListener(sessionport.datacomm.duplex.buffer.ASendingConnectListener)

Aggregations

ConnectionListener (inputport.ConnectionListener)1 ByteBuffer (java.nio.ByteBuffer)1 ABufferDuplexReceiveListener (sessionport.datacomm.duplex.buffer.ABufferDuplexReceiveListener)1 ASendingConnectListener (sessionport.datacomm.duplex.buffer.ASendingConnectListener)1