ILayeredSocketFactory.CreateSocket(Socket, String, Int32, Boolean) Method
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.
Returns a socket connected to the given host that is layered over an existing socket.
[Android.Runtime.Register("createSocket", "(Ljava/net/Socket;Ljava/lang/String;IZ)Ljava/net/Socket;", "GetCreateSocket_Ljava_net_Socket_Ljava_lang_String_IZHandler:Org.Apache.Http.Conn.Schemes.ILayeredSocketFactoryInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Net.Socket? CreateSocket (Java.Net.Socket? socket, string? host, int port, bool autoClose);
[<Android.Runtime.Register("createSocket", "(Ljava/net/Socket;Ljava/lang/String;IZ)Ljava/net/Socket;", "GetCreateSocket_Ljava_net_Socket_Ljava_lang_String_IZHandler:Org.Apache.Http.Conn.Schemes.ILayeredSocketFactoryInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member CreateSocket : Java.Net.Socket * string * int * bool -> Java.Net.Socket
Parameters
- socket
- Socket
the existing socket
- host
- String
the host name/IP
- port
- Int32
the port on the host
- autoClose
- Boolean
a flag for closing the underling socket when the created socket is closed
Returns
Socket a new socket
- Attributes
Exceptions
if an I/O error occurs while creating the socket
if the IP address of the host cannot be determined
Remarks
Returns a socket connected to the given host that is layered over an existing socket. Used primarily for creating secure sockets through proxies.
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.