Establishes a connection to a remote device.
Namespace:
Rebex.Net
Assembly:
Rebex.Tls (in Rebex.Tls.dll)
Syntax
Visual Basic |
---|
Public Function BeginConnect ( _ serverName As String, _ port As Integer, _ callback As AsyncCallback, _ state As Object _ ) As IAsyncResult |
C# |
---|
public IAsyncResult BeginConnect( string serverName, int port, AsyncCallback callback, Object state ) |
Parameters
- serverName
- Type: System..::..String
The hostname (or IP address) of the remote device.
- port
- Type: System..::..Int32
The port number associated with the hostname.
- callback
- Type: System..::..AsyncCallback
The AsyncCallback delegate.
- state
- Type: System..::..Object
An object containing state information for this request.
Return Value
An IAsyncResult that references the asynchronous connection.Remarks
The BeginConnect(String, Int32, AsyncCallback, Object) method establishes a network connection to a host identified
by the serverName and port
parameters. Once the connection has been made,
you can send data to the remote device with the BeginSend(array<Byte>[]()[][], Int32, Int32, SocketFlags, AsyncCallback, Object) method,
or receive data from the remote device with the BeginReceive(array<Byte>[]()[][], Int32, Int32, SocketFlags, AsyncCallback, Object) method.