다음을 통해 공유


SSLSocketFactory.ConnectSocket Method

Definition

Connects a socket to the given host.

[Android.Runtime.Register("connectSocket", "(Ljava/net/Socket;Ljava/lang/String;ILjava/net/InetAddress;ILorg/apache/http/params/HttpParams;)Ljava/net/Socket;", "GetConnectSocket_Ljava_net_Socket_Ljava_lang_String_ILjava_net_InetAddress_ILorg_apache_http_params_HttpParams_Handler")]
public virtual Java.Net.Socket? ConnectSocket (Java.Net.Socket? sock, string? host, int port, Java.Net.InetAddress? localAddress, int localPort, Org.Apache.Http.Params.IHttpParams? params);
[<Android.Runtime.Register("connectSocket", "(Ljava/net/Socket;Ljava/lang/String;ILjava/net/InetAddress;ILorg/apache/http/params/HttpParams;)Ljava/net/Socket;", "GetConnectSocket_Ljava_net_Socket_Ljava_lang_String_ILjava_net_InetAddress_ILorg_apache_http_params_HttpParams_Handler")>]
abstract member ConnectSocket : Java.Net.Socket * string * int * Java.Net.InetAddress * int * Org.Apache.Http.Params.IHttpParams -> Java.Net.Socket
override this.ConnectSocket : Java.Net.Socket * string * int * Java.Net.InetAddress * int * Org.Apache.Http.Params.IHttpParams -> Java.Net.Socket

Parameters

sock
Socket

the socket to connect, as obtained from CreateSocket(). null indicates that a new socket should be created and connected.

host
String

the host to connect to

port
Int32

the port to connect to on the host

localAddress
InetAddress

the local address to bind the socket to, or null for any

localPort
Int32

the port on the local machine, 0 or a negative number for any

params
IHttpParams

additional IHttpParams for connecting

Returns

Implements

Attributes

Exceptions

Remarks

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