DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Developing applications over TCP/IP using Internet sockets

Selecting a protocol (Internet domain)

To obtain a particular protocol, select the protocol number as defined within the communication domain. For the Internet domain, the available protocols are defined in netinet/in.h. You can also use one of the library routines such as getprotobyname in getprotoent(SLIB):

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
/* ... */
pp = getprotobyname("tcp");
s = socket(AF_INET, SOCK_STREAM, pp->p_proto);


Next topic: Socket creation errors
Previous topic: Creating a socket (Internet domain)

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003