Share via


ServerSocket.SetSocketFactory(ISocketImplFactory) Method

Definition

Sets the server socket implementation factory for the application.

[Android.Runtime.Register("setSocketFactory", "(Ljava/net/SocketImplFactory;)V", "")]
public static void SetSocketFactory (Java.Net.ISocketImplFactory? fac);
[<Android.Runtime.Register("setSocketFactory", "(Ljava/net/SocketImplFactory;)V", "")>]
static member SetSocketFactory : Java.Net.ISocketImplFactory -> unit

Parameters

fac
ISocketImplFactory

the desired factory.

Attributes

Exceptions

if the factory could not be set or is already set.

Remarks

Sets the server socket implementation factory for the application. The factory can be specified only once.

When an application creates a new server socket, the socket implementation factory's createSocketImpl method is called to create the actual socket implementation.

Passing null to the method is a no-op unless the factory was already set.

If there is a security manager, this method first calls the security manager's checkSetFactory method to ensure the operation is allowed. This could result in a SecurityException.

Java documentation for java.net.ServerSocket.setSocketFactory(java.net.SocketImplFactory).

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