org.apache.mina.protocol
Interface ProtocolAcceptor

All Superinterfaces:
ProtocolSessionManager, SessionManager
All Known Implementing Classes:
IoProtocolAcceptor, VmPipeAcceptor

public interface ProtocolAcceptor
extends ProtocolSessionManager

Accepts incoming connection, communicates with clients, and fires events to ProtocolHandlers.

Please refer to Reverser example.

You should bind to the desired socket address to accept incoming connections, and then events for incoming connections will be sent to the specified default ProtocolHandler.

Threads accept incoming connections start automatically when bind(SocketAddress, ProtocolProvider) is invoked, and stop when all addresses are unbound.

Version:
$Rev: 210062 $, $Date: 2005-07-11 12:52:38 +0900 $
Author:
Trustin Lee (trustin@apache.org)

Method Summary
 void bind(SocketAddress address, ProtocolProvider protocolProvider)
          Binds to the specified address and handles incoming connections with the specified protocolProvider.
 void unbind(SocketAddress address)
          Unbinds from the specified address.
 
Methods inherited from interface org.apache.mina.protocol.ProtocolSessionManager
getFilterChain
 
Methods inherited from interface org.apache.mina.common.SessionManager
getExceptionMonitor, setExceptionMonitor
 

Method Detail

bind

void bind(SocketAddress address,
          ProtocolProvider protocolProvider)
          throws IOException
Binds to the specified address and handles incoming connections with the specified protocolProvider.

Throws:
IOException - if failed to bind

unbind

void unbind(SocketAddress address)
Unbinds from the specified address.



Copyright © 2004-2005 . All Rights Reserved.