Class Acceptor
java.lang.Object
io.deephaven.enterprise.comm.sched.Job
io.deephaven.enterprise.niowrapper.sched.Acceptor
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable
This class creates new IOJobs by listening for incoming connections on a ServerSocket.
Created by IntelliJ IDEA. User: jrauser Date: Sep 26, 2006 Time: 7:58:40 PM To change this template use File |
Settings | File Templates.
-
Constructor Summary
ConstructorsConstructorDescriptionAcceptor(Scheduler sched, int portMin, int portMax, IOParameters parameters, IOStats stats, IOHandler handler, com.fishlib.base.Procedure.Unary<SocketChannel> rawSocketHandler, boolean oneShot, com.fishlib.io.logger.Logger log, com.fishlib.base.Procedure.Unary<Socket> acceptedSocketCallback) Acceptor(Scheduler sched, int port, IOParameters parameters, IOStats stats, IOHandler handler, com.fishlib.base.Procedure.Unary<SocketChannel> rawSocketHandler, boolean oneShot, com.fishlib.io.logger.Logger log, com.fishlib.base.Procedure.Unary<Socket> acceptedSocketCallback) -
Method Summary
Modifier and TypeMethodDescriptioncom.fishlib.base.log.LogOutputappend(com.fishlib.base.log.LogOutput logOutput) Append this acceptor to a logvoidclean up when we are cancelled from the scheduler.Returns the inet address on which the acceptor's server socket is listening.Returns the acceptor's IOParametersReturns the acceptor's server socket.intinvoke(SelectableChannel channel, int readyOps, com.fishlib.base.Procedure.Nullary handoff) Accept new connections when invoked by the scheduler.voidshutdown()Shut down the listener, cancelling it's job and closing the scheduler.voidtimedOut()clean up the scheduler detects a timeout on the acceptor.Methods inherited from class io.deephaven.enterprise.comm.sched.Job
getStateFor, makeStateFor
-
Constructor Details
-
Acceptor
public Acceptor(Scheduler sched, int port, IOParameters parameters, IOStats stats, IOHandler handler, com.fishlib.base.Procedure.Unary<SocketChannel> rawSocketHandler, boolean oneShot, com.fishlib.io.logger.Logger log, com.fishlib.base.Procedure.Unary<Socket> acceptedSocketCallback) throws IOException - Throws:
IOException
-
Acceptor
public Acceptor(Scheduler sched, int portMin, int portMax, IOParameters parameters, IOStats stats, IOHandler handler, com.fishlib.base.Procedure.Unary<SocketChannel> rawSocketHandler, boolean oneShot, com.fishlib.io.logger.Logger log, com.fishlib.base.Procedure.Unary<Socket> acceptedSocketCallback) throws IOException - Throws:
IOException
-
-
Method Details
-
getSocket
Returns the acceptor's server socket. -
getAddress
Returns the inet address on which the acceptor's server socket is listening. -
getIOParameters
Returns the acceptor's IOParameters -
append
public com.fishlib.base.log.LogOutput append(com.fishlib.base.log.LogOutput logOutput) Append this acceptor to a log -
shutdown
public void shutdown()Shut down the listener, cancelling it's job and closing the scheduler. -
invoke
public int invoke(SelectableChannel channel, int readyOps, com.fishlib.base.Procedure.Nullary handoff) throws IOException Accept new connections when invoked by the scheduler.- Specified by:
invokein classJob- Parameters:
channel- the channel which has become readyreadyOps- the operations which can be performed on this channel without blocking- Returns:
- the modified readyOps after the invocation; if non-zero, the job will be invoked again with these
- Throws:
IOException- - if something bad happens
-
cancelled
public void cancelled()clean up when we are cancelled from the scheduler. -
timedOut
public void timedOut()clean up the scheduler detects a timeout on the acceptor.
-