Click or drag to resize

ConnectionOpen(OpenFlags, Object) Method

Opens (or reopens) the socket.

Namespace: Demo3D.Net
Assembly: Demo3D.IO (in Demo3D.IO.dll) Version: 19.00.00
Syntax
C#
public void Open(
	OpenFlags openFlags = OpenFlags.Default,
	Object? userState = null
)

Parameters

openFlags  OpenFlags  (Optional)
Additional flags.
userState  Object  (Optional)
User state.
Example
C#
public Client<IPacketIOService> OpenClient(string host, int port) {
    // Create a connection to a client, without opening it.
    var client = TcpClient.Open(host, port, OpenFlags.NoOpen);

    // Get the protocol properties and set TCP.ReceiveTimeout to 1 second.
    dynamic properties            = client.Properties;
    properties.TCP.ReceiveTimeout = 1000;

    // Open the connection.
    client.Open();

    return client;
}
See Also