Programming generic programming interface support for

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: Support for message oriented and connection connection oriented communication. • Operating System independence Desired Desired properties of Network API 12 ECEN 602 Socket Programming • Support multiple communication protocol suites (families). • Address (endpoint) representation independence. independence. Generic Generic Programming Interface 13 ECEN 602 Socket Programming • TCP/IP does not include an API definition. TCP/IP TCP/IP 14 ECEN 602 Socket Programming • Specify local and remote communication endpoints • Initiate a connection • Wait for incoming connection • Send and receive data • Terminate a connection gracefully • Error handling Functions Functions needed: 15 ECEN 602 Socket Programming – support for multiple protocol families. – address representation independence • Generic: Berkeley Berkeley Sockets 16 ECEN 602 Socket Programming – establishing a connection – specifying communication endpoint addresses • A socket is an abstract representation of a communication endpoint. • Need of Sockets: Socket Socket 17 ECEN 602 Socket Programming • family specifies the protocol family (PF_INET for TCP/IP). • type specifies the type of service (SOCK_STREAM, SOCK_DGRAM). SOCK_DGRAM • protocol specifies the specific protocol (usually 0, which means the default). the int socket(int family,int type,int proto); Creating Creating a Socket 18 ECEN 602 Socket Programming • socket() allocates resources needed for a communication endpoint - but it does not deal with endpoint addressing. • The socket() system call returns a socket() socket descriptor (small integer) or -1 on on error. socket() socket() 19 ECEN 602 Socket Programming • Remember that the sockets API is generic. • There m...
View Full Document

This document was uploaded on 01/29/2014.

Ask a homework question - tutors are online