ServerSocket Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| ServerSocket() |
Creates an unbound server socket. |
| ServerSocket(Int32) |
Creates a server socket, bound to the specified port. |
| ServerSocket(Int32, Int32) |
Creates a server socket and binds it to the specified local port number, with the specified backlog. |
| ServerSocket(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
| ServerSocket(Int32, Int32, InetAddress) |
Create a server with the specified port, listen backlog, and local IP address to bind to. |
ServerSocket()
Creates an unbound server socket.
[Android.Runtime.Register(".ctor", "()V", "")]
public ServerSocket ();
- Attributes
Exceptions
if an error occurs while creating the socket.
Remarks
Java documentation for java.net.ServerSocket.ServerSocket().
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ServerSocket(Int32)
Creates a server socket, bound to the specified port.
[Android.Runtime.Register(".ctor", "(I)V", "")]
public ServerSocket (int port);
[<Android.Runtime.Register(".ctor", "(I)V", "")>]
new Java.Net.ServerSocket : int -> Java.Net.ServerSocket
Parameters
- port
- Int32
the port number, or 0 to use a port
number that is automatically allocated.
- Attributes
Exceptions
if an error occurs while creating the socket.
Remarks
Java documentation for java.net.ServerSocket.ServerSocket(int).
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ServerSocket(Int32, Int32)
Creates a server socket and binds it to the specified local port number, with the specified backlog.
[Android.Runtime.Register(".ctor", "(II)V", "")]
public ServerSocket (int port, int backlog);
[<Android.Runtime.Register(".ctor", "(II)V", "")>]
new Java.Net.ServerSocket : int * int -> Java.Net.ServerSocket
Parameters
- port
- Int32
the port number, or 0 to use a port
number that is automatically allocated.
- backlog
- Int32
requested maximum length of the queue of incoming connections.
- Attributes
Exceptions
if an error occurs while creating the socket.
Remarks
Java documentation for java.net.ServerSocket.ServerSocket(int, int).
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ServerSocket(IntPtr, JniHandleOwnership)
A constructor used when creating managed representations of JNI objects; called by the runtime.
protected ServerSocket (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Net.ServerSocket : nativeint * Android.Runtime.JniHandleOwnership -> Java.Net.ServerSocket
Parameters
- transfer
- JniHandleOwnership
A JniHandleOwnershipindicating how to handle javaReference
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
ServerSocket(Int32, Int32, InetAddress)
Create a server with the specified port, listen backlog, and local IP address to bind to.
[Android.Runtime.Register(".ctor", "(IILjava/net/InetAddress;)V", "")]
public ServerSocket (int port, int backlog, Java.Net.InetAddress? bindAddr);
[<Android.Runtime.Register(".ctor", "(IILjava/net/InetAddress;)V", "")>]
new Java.Net.ServerSocket : int * int * Java.Net.InetAddress -> Java.Net.ServerSocket
Parameters
- port
- Int32
the port number, or 0 to use a port
number that is automatically allocated.
- backlog
- Int32
requested maximum length of the queue of incoming connections.
- bindAddr
- InetAddress
the local InetAddress the server will bind to
- Attributes
Exceptions
if an error occurs while creating the socket.
Remarks
Java documentation for java.net.ServerSocket.ServerSocket(int, int, java.net.InetAddress).
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.