socket_connect4 man page on Alpinelinux

Man page or keyword search:  
man Server   18016 pages
apropos Keyword Search (all sections)
Output format
Alpinelinux logo
[printable version]

socket_connect4(3)					    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

       ·      0, to indicate that  the	connection  succeeded  (and  succeeded
	      immediately, if the socket is non-blocking)

       ·      -1,  setting  errno  to error_inprogress or error_wouldblock, to
	      indicate that the socket is non-blocking

       ·      -1, setting errno to something else, to indicate that  the  con‐
	      nection  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 appro‐
       priately.

       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)
[top]

List of man pages available for Alpinelinux

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net