1 2 3 4 5 6
#include <netinet/in.h> int getsockport(int sd); int bind_any(int minport); int connect_to_host(char *hostname, int port); int connect_to_peer(struct sockaddr_in *peer, int port);