TBlockSocket.Connect
TBlockSocket     

procedure Connect(IP, Port: string); virtual;

Unit
blcksock

Description
Connects socket to remote IP address and PORT. The same rules as with BIND method are valid. The only exception is that PORT with 0 value will not be connected.

If you use stream type of socket (like TCP), after call to this method a communication channel between local and remote socket is created. Local socket is assigned automatically if not controlled by previous call to BIND method.

On datagram type (like UDP) is only seting filters for datagrams. Only datagrams incoming from remote IP and port is passed to your application and you may it read by RecvBuffer function and send datagrams to this remote side by SendBuffer function.

Structures LocalSin and RemoteSin will be filled with valid values.

Note: If you call this on non-created socket, then socket is created automaticly.


See also:
Bind, LocalSin, RecvBuffer, RemoteSin, SendBuffer