IFiberSocketConnection.connect

Attempts to connect to the remote host, suspending the fiber if establishing the connection does not immediately succeed or fail. If a connection to the same address and port is already established, the Already flag is set in the return value. If a connection to a different address and port is already established, this connection is closed and a new connection is opened.

class IFiberSocketConnection
abstract
connect
(,
ushort port
,
bool force = false
)

Parameters

address cstring

remote IP address

port ushort

remote TCP port

force bool

false: don't call connect() if currently connected to the same address and port; true: always call connect()

Return Value

ConnectionStatus.Connected if the connection was newly established or ConnectionStatus.Connected | ConnectionStatus.Already if the connection was already established.

Throws

- SocketError (IOException) on fatal I/O error, - IOWarning if the remote hung up.

Meta