Package com.ngrok.net
Class ListenerServerSocket
- java.lang.Object
-
- java.net.ServerSocket
-
- com.ngrok.net.ListenerServerSocket
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ListenerServerSocket extends ServerSocket
A server socket for accepting connections from aListener
.
-
-
Constructor Summary
Constructors Constructor Description ListenerServerSocket(Listener listener)
Creates a new server socket for the given listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Socket
accept()
Accepts a connection to the server socket.-
Methods inherited from class java.net.ServerSocket
bind, bind, close, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getOption, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, supportedOptions, toString
-
-
-
-
Constructor Detail
-
ListenerServerSocket
public ListenerServerSocket(Listener listener) throws IOException
Creates a new server socket for the given listener.- Parameters:
listener
- the listener to accept connections for- Throws:
IOException
- if an I/O error occurs
-
-
Method Detail
-
accept
public Socket accept() throws IOException
Accepts a connection to the server socket.- Overrides:
accept
in classServerSocket
- Returns:
- A
Socket
for the accepted connection - Throws:
IOException
- if an I/O error occursSocketException
- if the socket is closed
-
-