O'Reilly logo

Linux Socket Programming by Example by Warren W. Gay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Socket Function Quick Reference

Socket-Specific Functions

socketpair(2)

#include <sys/types.h>
#include <sys/socket.h>

int socketpair(int domain, int type, int protocol, int sv[2]);

socket(2)

#include <sys/types.h>
#include <sys/socket.h>

int socket(int domain, int type, int protocol);

bind(2)

#include <sys/types.h>
#include <sys/socket.h>

int bind(int sockfd, struct sockaddr *my_addr, int addrlen);

connect(2)

#include <sys/types.h>
#include <sys/socket.h>

int connect(int sockfd, struct sockaddr *serv_addr, int addrlen);

listen(2)

#include <sys/socket.h>

int listen(int s, int backlog);

accept(2)

#include <sys/types.h>
#include <sys/socket.h>

int accept(int s, struct sockaddr *addr, int *addrlen);

Socket Addressing

getsockname(2)

 #include ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required