Holger's
Java API

com.antelmann.net
Interface ConnectionDispatcher

All Known Implementing Classes:
ChatServer, GameServer, JMessenger, NetConnectionServer.DefaultDispatcher

public interface ConnectionDispatcher

used by a NetConnectionServer object to create a Thread that handles incoming connections

Author:
Holger Antelmann
See Also:
NetConnectionServer, NetConnectionHandler, NetConnection

Method Summary
 NetConnection createConnection(Socket socket)
          produces a NetConnection based on the given socket.
 NetConnectionHandler createHandler(NetConnection con)
          produces a NetConnectionHandler which will be started in a new Thread (created by the NetConnectionServer's ThreadFactory) to handle the given NetConnection and listens to messages.
 Handshake getHandshake()
          returns a signature object used to identify the desired connection type handled by this ConnectionDispatcher object
 

Method Detail

createConnection

NetConnection createConnection(Socket socket)
                               throws IOException
produces a NetConnection based on the given socket.

Throws:
IOException
See Also:
SocketConnection.createServerConnection(Socket, Handshake)

createHandler

NetConnectionHandler createHandler(NetConnection con)
produces a NetConnectionHandler which will be started in a new Thread (created by the NetConnectionServer's ThreadFactory) to handle the given NetConnection and listens to messages. Typically, the returned object could be a MessageDelegator.

See Also:
MessageDelegator

getHandshake

Handshake getHandshake()
returns a signature object used to identify the desired connection type handled by this ConnectionDispatcher object



(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads