Socket.SetSocketImplFactory(ISocketImplFactory) Method

Definition

Sets the client socket implementation factory for the application.

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

Parameters

fac
ISocketImplFactory

the desired factory.

Attributes

Exceptions

if the factory has been already set.

Remarks

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

When an application creates a new client 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.Socket.setSocketImplFactory(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