Package dev.forbit.server.abstracts
Class TCPServer
java.lang.Object
java.lang.Thread
dev.forbit.server.abstracts.TCPServer
- All Implemented Interfaces:
 ConnectionServer,Runnable
- Direct Known Subclasses:
 GSONTCPServer,RawTCPServer
- 
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler - 
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionabstract ConnectionPacketDefines the Packet used for new connectionsbooleaninit()Initialise the server.voidloop()The basic loop that happens every tickvoidrun()intselect()Gets the key IDMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yieldMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.forbit.server.interfaces.ConnectionServer
begin, getAddress, getPort, getServer, getString, isRunning, setRunning, shutdown, start 
- 
Constructor Details
- 
TCPServer
public TCPServer() 
 - 
 - 
Method Details
- 
run
public void run() - 
getConnectionPacket
Defines the Packet used for new connections- Returns:
 - ConnectionPacket
 
 - 
init
public boolean init()Description copied from interface:ConnectionServerInitialise the server.- Specified by:
 initin interfaceConnectionServer- Returns:
 - false if an error occured
 
 - 
loop
public void loop()Description copied from interface:ConnectionServerThe basic loop that happens every tick- Specified by:
 loopin interfaceConnectionServer
 - 
select
public int select()Gets the key ID- Returns:
 - the number of keys, or -1 for an exception
 
 
 -