- All Superinterfaces:
AutoCloseable,Closeable
Each socket, regardless or protocol and whether client or server, has a
context.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddSocketContextListener(SocketContextListener listener, boolean synchronous) voidclose()Closes this context.getSocket(Identifier id) Gets the socket of the given ID ornullif not found.Map<Identifier, ? extends Socket> Gets a snapshot of all active sockets.booleanisClosed()Checks if this context is closed.boolean
-
Method Details
-
getSockets
Map<Identifier,? extends Socket> getSockets()Gets a snapshot of all active sockets. If context is closed will be an empty map. -
getSocket
Gets the socket of the given ID ornullif not found. -
close
Closes this context. When the context is closed, all active sockets are closed and all related persistent resources are freed.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
isClosed
boolean isClosed()Checks if this context is closed. -
addSocketContextListener
-
removeSocketContextListener
-
