|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.echomine.net.Connection
com.echomine.net.TimeableConnection
com.echomine.net.HandshakeableSocketAcceptor
com.echomine.net.HandshakeablePerpetualSocketAcceptor
public class HandshakeablePerpetualSocketAcceptor
Accepts connections indefinitely. Once a connection is accepted, it is immediately handled in a spawned thread. The acceptor will go back to receiving more connections.
The socket acceptor work similar to PerpetualSocketAcceptor
PerpetualSocketAcceptor
Field Summary |
---|
Fields inherited from class com.echomine.net.HandshakeableSocketAcceptor |
---|
socket |
Fields inherited from class com.echomine.net.Connection |
---|
listenerList |
Constructor Summary | |
---|---|
HandshakeablePerpetualSocketAcceptor()
|
|
HandshakeablePerpetualSocketAcceptor(ConnectionModel model)
|
|
HandshakeablePerpetualSocketAcceptor(ConnectionModel model,
int backlog)
|
Method Summary | |
---|---|
void |
aaccept(HandshakeableSocketHandler socketHandler)
Accepts a connection,hands it over to the handler for processing, and immediately goes back to accepting more connections. |
void |
accept(HandshakeableSocketHandler socketHandler)
Accepts a connection and hands it over to the handler for processing one at a time. |
void |
close()
Closes the server socket, unbind from the port, and shuts down the perpetual loops. |
Methods inherited from class com.echomine.net.HandshakeableSocketAcceptor |
---|
getConnectionModel, open, setConnectionModel, setConnectionModel |
Methods inherited from class com.echomine.net.TimeableConnection |
---|
fireConnectionClosed, fireConnectionEstablished |
Methods inherited from class com.echomine.net.Connection |
---|
addConnectionListener, fireConnectionStarting, fireConnectionStartingWithoutVeto, removeConnectionListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HandshakeablePerpetualSocketAcceptor()
public HandshakeablePerpetualSocketAcceptor(ConnectionModel model) throws java.io.IOException
java.io.IOException
public HandshakeablePerpetualSocketAcceptor(ConnectionModel model, int backlog) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void accept(HandshakeableSocketHandler socketHandler)
Accepts a connection and hands it over to the handler for processing one at a time.
To stop the daemon from accepting more connections, just call the close method.
The method will return immediately and run the daemon in a background thread.
accept
in class HandshakeableSocketAcceptor
public void aaccept(HandshakeableSocketHandler socketHandler)
Accepts a connection,hands it over to the handler for processing, and immediately goes back to accepting more connections. This differs from the regular accept method in that it does not process connections one at a time.
The async accept is a little more intricate than the sync accept since it can't just use SocketAcceptor.aaccept().
The method returns immediately and runs the daemon in a background thread.
aaccept
in class HandshakeableSocketAcceptor
public void close()
close
in class HandshakeableSocketAcceptor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |