TCP/IP Programming Manual
Contents
About This Document...................................................................................11
Supported Release Version Updates (RVUs)................................................................................11
Intended Audience..................................................................................................................11
New and changed information for March 2014 (524521-020)......................................................11
New and changed information for February 2013 (524521-019)...................................................11
New and changed information for July 2012 (524521-018)...........................................................11
New and changed information for February 2012 (524521-017)...................................................11
New and changed information for August 2011 (524521-016)..................................................12
New and Changed Information for October 2010 (524521-015)...............................................12
Changes and Additions for September 2010 (524521-014)......................................................12
Changes and Additions for March 2010 Update (524521-013).................................................12
Changes and Additions for September 2008 Update (524521-012)..........................................12
Changes and Additions January 2007 Update (524521-010)...................................................13
Changes and Additions for the H06.05 RVU (February 2006, 524521-009)..............................13
Changes and Additions for the G06.27 RVU (September 2005, 524521-007)...........................13
Changes and Additions for the H06.03 RVU (July, 2005 524521-006)......................................13
Correction Update (December 2004, 524521-005)................................................................14
Correction Update (September 2004, 524521-004)................................................................14
Manual Consolidation Update (March 2004, 524521-003).....................................................14
G06.22 RVU Update (December 2003, 524521-002)............................................................15
G06.20 RVU Update (May 2003, 524521-001).....................................................................15
Document Organization..........................................................................................................15
Notation Conventions..............................................................................................................16
General Syntax Notation....................................................................................................16
Notation for Messages.......................................................................................................18
Notation for Subnet............................................................................................................19
Notation for Management Programming Interfaces.................................................................19
Related Information.................................................................................................................20
Publishing History...................................................................................................................21
HP Encourages Your Comments................................................................................................21
Request for Comments (RFC) Statement......................................................................................21
1 Introduction to Programming to the Guardian Sockets Library.........................23
NonStop TCP/IP Subsystems and the Guardian Sockets Application Program Interface (API).............23
TCP/IP Programming Fundamentals..........................................................................................24
Using NonStop TCP/IP and NonStop TCP/IPv6 or Parallel Library TCP/IP.................................24
Using CIP.........................................................................................................................24
Types of Service.................................................................................................................25
The Socket Library Routines.................................................................................................25
Stream-Oriented Protocol Considerations...............................................................................26
Passive Connect Compared to Active Connect........................................................................26
Starting Clients and Servers.................................................................................................29
Port Numbers....................................................................................................................31
Network and Host Order....................................................................................................32
Programming Using the Guardian Sockets Interface....................................................................32
Porting Considerations........................................................................................................32
Nowait I/O......................................................................................................................32
Differences Between UNIX and NonStop Server Implementations.............................................33
Basic Steps for Programs.........................................................................................................35
NonStop TCP/IP, Parallel Library TCP/IP, and NonStop TCP/IPv6 Basic Steps............................35
TCP Client and Server Programs...........................................................................................39
UDP Client and Server Programs..........................................................................................40
Contents 3