Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

Socketadds


Functions

int TcpConnect (TCPSOCKET *sock, u_long addr, u_short port, u_short lport)
 Connect to a remote socket.


Function Documentation

int TcpConnect TCPSOCKET   sock,
u_long    addr,
u_short    port,
u_short    lport
 

Connect to a remote socket.

This function tries to establish a connection on specified local port to the specified remote port of the specified remote server. The calling thread will be suspended until a connection is successfully established or an error occurs.

This function is typically used by TCP client applications.

Parameters:
sock  Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket().
addr  IP address of the host to connect (network byte order).
port  Port number to connect (host byte order).
lport  Local port number (host byte order).
Returns:
0 on success, -1 otherwise. The specific error code can be retrieved by calling NutTcpError().


Generated on Thu Jan 30 22:30:57 2003 for EduNet by doxygen1.2.18