Package jexer.net
Class TelnetServerSocket
- java.lang.Object
-
- java.net.ServerSocket
-
- jexer.net.TelnetServerSocket
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class TelnetServerSocket extends java.net.ServerSocket
This class provides a ServerSocket that return TelnetSocket's in accept().
-
-
Constructor Summary
Constructors Constructor Description TelnetServerSocket()
Creates an unbound server socket.TelnetServerSocket(int port)
Creates a server socket, bound to the specified port.TelnetServerSocket(int port, int backlog)
Creates a server socket and binds it to the specified local port number, with the specified backlog.TelnetServerSocket(int port, int backlog, java.net.InetAddress bindAddr)
Create a server with the specified port, listen backlog, and local IP address to bind to.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.Socket
accept()
Listens for a connection to be made to this socket and accepts it.-
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
-
TelnetServerSocket
public TelnetServerSocket() throws java.io.IOException
Creates an unbound server socket.- Throws:
java.io.IOException
- if an I/O error occurs
-
TelnetServerSocket
public TelnetServerSocket(int port) throws java.io.IOException
Creates a server socket, bound to the specified port.- Parameters:
port
- the port number, or 0 to use a port number that is automatically allocated.- Throws:
java.io.IOException
- if an I/O error occurs
-
TelnetServerSocket
public TelnetServerSocket(int port, int backlog) throws java.io.IOException
Creates a server socket and binds it to the specified local port number, with the specified backlog.- Parameters:
port
- the port number, or 0 to use a port number that is automatically allocated.backlog
- requested maximum length of the queue of incoming connections.- Throws:
java.io.IOException
- if an I/O error occurs
-
TelnetServerSocket
public TelnetServerSocket(int port, int backlog, java.net.InetAddress bindAddr) throws java.io.IOException
Create a server with the specified port, listen backlog, and local IP address to bind to.- Parameters:
port
- the port number, or 0 to use a port number that is automatically allocated.backlog
- requested maximum length of the queue of incoming connections.bindAddr
- the local InetAddress the server will bind to- Throws:
java.io.IOException
- if an I/O error occurs
-
-
Method Detail
-
accept
public java.net.Socket accept() throws java.io.IOException
Listens for a connection to be made to this socket and accepts it. The method blocks until a connection is made.- Overrides:
accept
in classjava.net.ServerSocket
- Returns:
- the new Socket
- Throws:
java.io.IOException
- if an I/O error occurs
-
-