Institute cary nc sasc c compiler rd slide 21 feb

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: dotted decimal string) perror() - print error message (based on “errno”) to stderr herror() - print error message for gethostbyname() to stderr (used with DNS) SAS Institute Inc. Institute Cary, NC SAS/C & C++ Compiler R&D Slide 21 Feb. 1998 C Socket Programming Tutorial SHARE Session 5958 Primary Header Files U Include file sequence may affect processing (order is important!) • • • • • • <sys/types.h> <errno.h> <sys/socket.h> <netdb.h.h> <netinet/in.h> <arpa/inet.h> SAS Institute Inc. Institute Cary, NC - prerequisite typedefs - names for “errno” values (error numbers) - struct sockaddr; system prototypes and constants - network info lookup prototypes and structures - struct sockaddr_in; byte ordering macros - utility function prototypes SAS/C & C++ Compiler R&D Slide 22 Feb. 1998 C Socket Programming Tutorial SHARE Session 5958 Sample TCP Client / Server Session Iterative Server socket() Remote Client bind() listen() connect() recv()/send() recv()/send() close() Cary, NC gethostbyname() accept() SAS Institute Inc. Institute socket() close() SAS/C & C++ Compiler R&D Slide 23 Feb. 1998 C Socket Programming Tutorial SHARE Session 5958 Ancillary Socket Topics U U UDP versus TCP Controlling/managing socket characteristics • • • U U U get/setsockopt()...
View Full Document

This document was uploaded on 02/14/2014.

Ask a homework question - tutors are online