12.07.2015 Views

z/VM: TCP/IP Programmer's Reference - z/VM - IBM

z/VM: TCP/IP Programmer's Reference - z/VM - IBM

z/VM: TCP/IP Programmer's Reference - z/VM - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

|||ContentsPreface . . . . . . . . . . . . . . . ixWho Should Read This Book. . . . . . . . . ixWhat You Should Know before Reading This Book ixWhat This Book Contains . . . . . . . . . . ixHow to Use This Book . . . . . . . . . . . xiHow the Term “internet” Is Used in This Book. . xiWhere to Find More Information . . . . . . . xiService Information . . . . . . . . . . . . xiUnderstanding Syntax Diagrams . . . . . . . xiHow Numbers Are Used in This Book . . . . . xivHow to Send Your Comments to <strong>IBM</strong> . . . . . xivSummary of Changes . . . . . . . . xvFirst Edition for z/<strong>VM</strong> (February 2001) . . . . . xv<strong>IP</strong> Multicast . . . . . . . . . . . . . xvOther Changes . . . . . . . . . . . . xvSecond Edition for <strong>VM</strong>/ESA ® (July 1999) . . . . xvFirst Edition for <strong>VM</strong>/ESA . . . . . . . . . xvChapter 1. General ProgrammingInformation . . . . . . . . . . . . . 1Porting Considerations . . . . . . . . . . . 1Accessing System Return Messages . . . . . . 1Printing System Return Messages . . . . . . 1Compiling and Linking C Applications . . . . . 1Textlib (TXTLIB) Files . . . . . . . . . . 2<strong>TCP</strong>LOAD EXEC . . . . . . . . . . . . . 2Using <strong>TCP</strong>LOAD . . . . . . . . . . . . 3SET LDRTBLS Command . . . . . . . . . . 4Chapter 2. C Sockets ApplicationProgram Interface . . . . . . . . . . 5Programming with C Sockets . . . . . . . . . 5Socket Programming Concepts . . . . . . . 5Guidelines for Using Socket Types . . . . . . 6Addressing within Sockets. . . . . . . . . 6Main Socket Calls. . . . . . . . . . . . 8C Socket Library. . . . . . . . . . . . . 16Porting . . . . . . . . . . . . . . . . 17Environment Variables Used by the Sockets Library 17C Socket <strong>Reference</strong> . . . . . . . . . . . . 19C Socket Calls . . . . . . . . . . . . . 21accept(). . . . . . . . . . . . . . . 22bind() . . . . . . . . . . . . . . . 23close() . . . . . . . . . . . . . . . 27connect() . . . . . . . . . . . . . . 27endhostent() . . . . . . . . . . . . . 30endnetent() . . . . . . . . . . . . . 31endprotoent() . . . . . . . . . . . . . 31endservent() . . . . . . . . . . . . . 31fcntl() . . . . . . . . . . . . . . . 31getclientid() . . . . . . . . . . . . . 32getdtablesize() . . . . . . . . . . . . 33gethostbyaddr() . . . . . . . . . . . . 33gethostbyname() . . . . . . . . . . . . 34gethostent() . . . . . . . . . . . . . 35gethostid(). . . . . . . . . . . . . . 36gethostname() . . . . . . . . . . . . 36getibmsockopt() . . . . . . . . . . . . 36getnetbyaddr() . . . . . . . . . . . . 38getnetbyname() . . . . . . . . . . . . 39getnetent(). . . . . . . . . . . . . . 40getpeername() . . . . . . . . . . . . 40getprotobyname() . . . . . . . . . . . 41getprotobynumber() . . . . . . . . . . 41getprotoent() . . . . . . . . . . . . . 42getservbyname() . . . . . . . . . . . . 43getservbyport() . . . . . . . . . . . . 43getservent() . . . . . . . . . . . . . 44getsockname() . . . . . . . . . . . . 44getsockopt() . . . . . . . . . . . . . 45givesocket() . . . . . . . . . . . . . 49htonl() . . . . . . . . . . . . . . . 51htons() . . . . . . . . . . . . . . . 51ibmsflush() . . . . . . . . . . . . . 51inet_addr() . . . . . . . . . . . . . 52inet_lnaof() . . . . . . . . . . . . . 52inet_makeaddr() . . . . . . . . . . . . 53inet_netof() . . . . . . . . . . . . . 53inet_network() . . . . . . . . . . . . 53inet_ntoa(). . . . . . . . . . . . . . 54ioctl() . . . . . . . . . . . . . . . 54listen() . . . . . . . . . . . . . . . 56maxdesc() . . . . . . . . . . . . . . 57ntohl() . . . . . . . . . . . . . . . 58ntohs() . . . . . . . . . . . . . . . 59read() . . . . . . . . . . . . . . . 59readv() . . . . . . . . . . . . . . . 60recv() . . . . . . . . . . . . . . . 61recvfrom() . . . . . . . . . . . . . . 62recvmsg() . . . . . . . . . . . . . . 63select() . . . . . . . . . . . . . . . 64selectex() . . . . . . . . . . . . . . 67send() . . . . . . . . . . . . . . . 68sendmsg() . . . . . . . . . . . . . . 69sendto() . . . . . . . . . . . . . . 70sethostent() . . . . . . . . . . . . . 72setibmsockopt() . . . . . . . . . . . . 72setnetent() . . . . . . . . . . . . . . 75setprotoent() . . . . . . . . . . . . . 75setservent() . . . . . . . . . . . . . 75setsockopt() . . . . . . . . . . . . . 76sockdb_sock_debug() . . . . . . . . . . 79sock_debug_bulk_perf0 (). . . . . . . . . 80sock_do_bulkmode() . . . . . . . . . . 80sock_do_teststor() . . . . . . . . . . . 81shutdown() . . . . . . . . . . . . . 81socket() . . . . . . . . . . . . . . . 82takesocket() . . . . . . . . . . . . . 85tcperror() . . . . . . . . . . . . . . 86© Copyright <strong>IBM</strong> Corp. 1987, 2001 iii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!