-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- Enclosing class:
- Network
public static interface Network.Server extends java.io.Closeable
This class represents a listening server connection ready to accept clients.The
onAccept()
callback will be called for each new accepted connection.Once and if the listening connection is closed, the
onClose()
callback will be called.You may call the
Closeable.close()
method to close the connection yourself.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isSecure()
Returns whether or not future accepted connections will be secure (typically using TLS or some other encryption mechanism)Callback<Network.Connection,Network.Server>
onAccept()
Gets the callback object that will be called with newly established connectionsCallback<java.lang.Void,Network.Server>
onClose()
Gets the callback object that will be called once the connection is closed.
-
-
-
Method Detail
-
onAccept
Callback<Network.Connection,Network.Server> onAccept()
Gets the callback object that will be called with newly established connections- Returns:
- the onAccept callback
-
onClose
Callback<java.lang.Void,Network.Server> onClose()
Gets the callback object that will be called once the connection is closed.- Returns:
- the onClose callback
-
isSecure
boolean isSecure()
Returns whether or not future accepted connections will be secure (typically using TLS or some other encryption mechanism)- Returns:
- whether or not future accepted connections will be secure
-
-