debian man page for socket_connect4

Query: socket_connect4

OS: debian

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

socket_connect4(3)					     Library Functions Manual						socket_connect4(3)

NAME
socket_connect4 - attempt to make a TCP connection
SYNTAX
#include <socket.h> int socket_connect4(int s,const char ip[4],uint16 port);
DESCRIPTION
socket_connect4 attempts to make a connection from TCP socket s to TCP port port on IP address ip. socket_connect4 may return o 0, to indicate that the connection succeeded (and succeeded immediately, if the socket is non-blocking) o -1, setting errno to error_inprogress or error_wouldblock, to indicate that the socket is non-blocking o -1, setting errno to something else, to indicate that the connection failed (and failed immediately, if the socket is non-blocking). When a background connection succeeds or fails, s becomes writable; you can use socket_connected to see whether the connection succeeded. If the connection failed, socket_connected returns 0, setting errno appropriately. Once a TCP socket is connected, you can use the read and write system calls to transmit data. You can call socket_connect4 without calling socket_bind4. This has the effect as first calling socket_bind4 with IP address 0.0.0.0 and port 0.
EXAMPLE
#include <socket.h> int s; char ip[4]; uint16 p; s = socket_tcp4(); socket_bind4(s,ip,p); socket_connect4(s,ip,p);
SEE ALSO
socket_connect6(3) socket_connect4(3)
Related Man Pages
socket_connect4(3) - debian
udp(4p) - ultrix
rresvport(3) - osf1
rresvport_af(3) - osf1
socket_connect(3) - php
Similar Topics in the Unix Linux Community
how to use function fork() in Windows NT
newbie terminology question...
about TCP connection
Error: No Route to host...urgent {socket() connection}
Which are blocking and non-blocking api's in sockets in C ?