com.threerings.nio
Class PolicyServer
java.lang.Object
java.lang.Thread
com.samskivert.util.LoopingThread
com.threerings.nio.conman.ConnectionManager
com.threerings.nio.PolicyServer
- All Implemented Interfaces:
- Lifecycle.BaseComponent, Lifecycle.ShutdownComponent, Runnable
public class PolicyServer
- extends ConnectionManager
Binds to a port and responds to "xmlsocket" requests on it with a policy file allowing access
to all ports from any host.
| Fields inherited from class com.threerings.nio.conman.ConnectionManager |
_acceptedq, _connections, _deathq, _handlers, _idleTime, _lastDebugStamp, _oflowHandler, _oflowqs, _onExit, _outbuf, _outq, _selectLoopTime, _selector, _selectorSelector, _stats, ASYNC_CLOSE_REQUEST, DEBUG_REPORT, DEBUG_REPORT_INTERVAL, LATENCY_GRACE |
|
Method Summary |
protected void |
didShutdown()
|
protected void |
handleAcceptedSocket(SocketChannel channel)
Adds a connection for the given socket to the managed set. |
void |
init(int socketPolicyPort)
Accepts xmlsocket requests on socketPolicyPort and responds any host may
connect to any port on this host. |
static void |
main(String[] args)
|
protected void |
willStart()
|
| Methods inherited from class com.threerings.nio.conman.ConnectionManager |
closeConnection, connectionClosed, connectionFailed, getStats, handleAcceptedSocket, handleIncoming, handleIterateFailure, iterate, noteWrite, postAsyncClose, processIncomingEvents, register, sendOutgoingMessages, setShutdownAction, transferAcceptedSocket, writeMessage |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
_acceptor
protected ServerSocketChannelAcceptor _acceptor
_policy
protected byte[] _policy
MASTER_PORT
protected static final int MASTER_PORT
- See Also:
- Constant Field Values
PolicyServer
@Inject
public PolicyServer(Lifecycle cycle)
throws IOException
- Throws:
IOException
main
public static void main(String[] args)
init
public void init(int socketPolicyPort)
- Accepts xmlsocket requests on
socketPolicyPort and responds any host may
connect to any port on this host.
willStart
protected void willStart()
- Overrides:
willStart in class ConnectionManager
didShutdown
protected void didShutdown()
- Overrides:
didShutdown in class ConnectionManager
handleAcceptedSocket
protected void handleAcceptedSocket(SocketChannel channel)
- Description copied from class:
ConnectionManager
- Adds a connection for the given socket to the managed set.
- Specified by:
handleAcceptedSocket in class ConnectionManager