Class Server
java.lang.Object
java.lang.Thread
me.remigio07.chatplugin.api.proxy.util.socket.Server
- All Implemented Interfaces:
Runnable
Server socket. Obtain instances of this class
with
Server(InetAddress, int).-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, stop, suspend, threadId, toString, yield
-
Constructor Details
-
Server
Constructs a new server socket.Call
start()to start it up.- Parameters:
address- Server's addressport- Port's number [0 - 65535]- Throws:
IOException- If something goes wrongIllegalArgumentException- If port is outside of range [0 - 65535]
-
-
Method Details
-
start
public void start()Starts this server.Will do nothing if
Socket.isClosed(). -
run
Deprecated.Internal use only; do not call this method.Automatic client listener. -
shutdown
Shuts down this server and closes its socket.Will do nothing if
Socket.isClosed().- Throws:
IOException- If something goes wrong- See Also:
-
getSocket
Gets the socket associated with this server.- Returns:
- Server's socket
-
getClientHandlers
Gets the list of the connected client handlers.Do not modify the returned list.
- Returns:
- Client handlers' list
-