org.jumpi.impl.connector.tcp
Interface TcpAcceptListener
- All Known Implementing Classes:
- TcpConnector
- public interface TcpAcceptListener
A TcpAcceptListener receives notification of accepted sockets, which are
connection attempts from remote peers. The TcpAcceptListener must decide
whether to allow the Socket to be kept or not.
Method Summary |
boolean |
acceptSocket(java.net.Socket sock)
Callback notifying that a Socket has been accepted. |
acceptSocket
public boolean acceptSocket(java.net.Socket sock)
- Callback notifying that a Socket has been accepted. The
TcpAcceptListener must determine if the Socket shall be kept or
discarded. Sockets may not be allowed to be used after accept, since
the maximum number of active TcpConnections has been exceeded, or if an
existing connection exists for the remote peer etc.
- Parameters:
sock
- the accepted Socket.
- Returns:
- false if the Socket should be discarded and closed, or else kept
with true.
Copyright © 2003, Peter Jonathan Klauser.