|
NAMEsocket_connect4 - attempt to make a TCP connectionSYNTAX#include <libowfat/socket.h>int socket_connect4(int s,const char ip[4],uint16 port); DESCRIPTIONsocket_connect4 attempts to make a connection from TCP socket s to TCP port port on IP address ip.socket_connect4 may return
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 <libowfat/socket.h>int s; char ip[4]; uint16 p; s = socket_tcp4(); socket_bind4(s,ip,p); socket_connect4(s,ip,p); SEE ALSOsocket_connect6(3), socket_fastopen_connect4(3) Visit the GSP FreeBSD Man Page Interface. |