DatagramSocket.SetDatagramSocketImplFactory Method

Definition

Sets the datagram socket implementation factory for the application.

[Android.Runtime.Register("setDatagramSocketImplFactory", "(Ljava/net/DatagramSocketImplFactory;)V", "")]
public static void SetDatagramSocketImplFactory (Java.Net.IDatagramSocketImplFactory? fac);
[<Android.Runtime.Register("setDatagramSocketImplFactory", "(Ljava/net/DatagramSocketImplFactory;)V", "")>]
static member SetDatagramSocketImplFactory : Java.Net.IDatagramSocketImplFactory -> unit

Parameters

fac
IDatagramSocketImplFactory

the desired factory.

Attributes

Exceptions

if the factory has already been set.

Remarks

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

When an application creates a new datagram socket, the socket implementation factory's createDatagramSocketImpl method is called to create the actual datagram 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.

Added in 1.3.

Java documentation for java.net.DatagramSocket.setDatagramSocketImplFactory(java.net.DatagramSocketImplFactory).

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

See also