ServerSocket Class

Definition

This class implements server sockets.

[Android.Runtime.Register("java/net/ServerSocket", DoNotGenerateAcw=true)]
public class ServerSocket : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ICloseable
[<Android.Runtime.Register("java/net/ServerSocket", DoNotGenerateAcw=true)>]
type ServerSocket = class
    inherit Object
    interface ICloseable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
ServerSocket
Derived
Attributes
Implements

Remarks

Java documentation for java.net.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.

Constructors

ServerSocket()

Creates an unbound server socket.

ServerSocket(Int32)

Creates an unbound server socket.

ServerSocket(Int32, Int32)

Creates an unbound server socket.

ServerSocket(Int32, Int32, InetAddress)

Creates an unbound server socket.

ServerSocket(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Channel

Returns the unique java.nio.channels.ServerSocketChannel object associated with this socket, if any.

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
InetAddress

Returns the local address of this server socket.

IsBound

Returns the binding state of the ServerSocket.

IsClosed

Returns the closed state of the ServerSocket.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LocalPort

Returns the port number on which this socket is listening.

LocalSocketAddress

Returns the address of the endpoint this socket is bound to.

PeerReference (Inherited from Object)
ReceiveBufferSize

Gets the value of the SocketOptions#SO_RCVBUF SO_RCVBUF option for this ServerSocket, that is the proposed buffer size that will be used for Sockets accepted from this ServerSocket. -or- Sets a default proposed value for the SocketOptions#SO_RCVBUF SO_RCVBUF option for sockets accepted from this ServerSocket.

ReuseAddress

Tests if SocketOptions#SO_REUSEADDR SO_REUSEADDR is enabled. -or- Enable/disable the SocketOptions#SO_REUSEADDR SO_REUSEADDR socket option.

SoTimeout

Retrieve setting for SocketOptions#SO_TIMEOUT SO_TIMEOUT. -or- Enable/disable SocketOptions#SO_TIMEOUT SO_TIMEOUT with the specified timeout, in milliseconds.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Accept()

Listens for a connection to be made to this socket and accepts it.

AcceptAsync()
Bind(SocketAddress)

Binds the ServerSocket to a specific address (IP address and port number).

Bind(SocketAddress, Int32)

Binds the ServerSocket to a specific address (IP address and port number).

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Close()

Closes this socket.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
ImplAccept(Socket)

Subclasses of ServerSocket use this method to override accept() to return their own subclass of socket.

ImplAcceptAsync(Socket)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetPerformancePreferences(Int32, Int32, Int32)

Sets performance preferences for this ServerSocket.

SetSocketFactory(ISocketImplFactory)

Sets the server socket implementation factory for the application.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to