正在加载图片...
Conceptual interface specification Implementation of an API The TCP/IP standards do not leave All implementations of a particular API appear the ithout any guidance. or functions)that ar They specify a conceptual interface: a set of an call to establish communication or send procedures and functions nd receive data The conceptual interface defined by TCP/IP In practice, the implementation of the API depend standards does not specify data representations or programming details or it might reside in a region of memory devoted te It merely provides an example of one possible interface that an OS can offer to application Win95/98 uses a shared lib scheme known as programs that use TCP/IP. Implementation of an API Implementation of an API Win95/98 a windows NT/2000/XP uses a hybrid sche that includes both a dll and resident ce App programs @- LL containing socket interface procedures DLL containing TCP/IP software]-TCPnP functions ing socket interface procedures.-Socket API TCP/IP functions Operating System Function Operating System Functions yo function Two basic approaches to Implementation of an API network communication Other implementations are possible. OS with no DLL support, all the procedures in API are The designer invents entirely new procedures calls that applications use to es fhe socket API without knowing how the aPI is Windows uses this method The programmer makes procedure calls which may a The designer attempts to use convention he application I/O calls to access TCP/IP procedures in DLL, or procedures in OS. Unix uses this metho App programs Socket API, Operating System Function2 哈工大计算机学院 李全龙 Network Application Development Socket Programming 7 Conceptual interface specification „ The TCP/IP standards do not leave implementors without any guidance. „ They specify a conceptual interface: a set of procedures and functions. „ The conceptual interface defined by TCP/IP standards does not specify data representations or programming details; „ It merely provides an example of one possible interface that an OS can offer to application programs that use TCP/IP. 哈工大计算机学院 李全龙 Network Application Development Socket Programming 8 Implementation of an API „ All implementations of a particular API appear the same to programmers: the API merely consists of a set of procedures ( or functions) that an application program can call to establish communication or send and receive data. „ In practice, the implementation of the API depends on the underlying system. „ Sharing API code might reside in the computer’s OS, or it might reside in a region of memory devoted to shared libraries. „ Win95/98 uses a shared lib scheme known as Dynamic Linked Library (DLL). 哈工大计算机学院 李全龙 Network Application Development Socket Programming 9 Implementation of an API „ Win95/98 : Operating System Functions DLL containing TCP/IP software DLL containing socket interface procedures App1 App2 …… Appn I/O functions TCP/IP functions Socket API App programs 哈工大计算机学院 李全龙 Network Application Development Socket Programming 10 Implementation of an API „ Windows NT/2000/XP uses a hybrid scheme that includes both a DLL and resident code. Operating System Functions DLL containing socket interface procedures App1 App2 …… Appn TCP/IP functions and I/O functions Socket API App programs 哈工大计算机学院 李全龙 Network Application Development Socket Programming 11 Implementation of an API „ Other implementations are possible. „ OS with no DLL support, all the procedures in API are part of OS. „ A programmer can create an application program that uses the socket API without knowing how the API is implemented. „ The programmer makes procedure calls which may invoke procedures that are linked into the application, procedures in DLL, or procedures in OS. Operating System Functions App1 App2 …… Appn Socket API, TCP/IP functions and I/O functions App programs 哈工大计算机学院 李全龙 Network Application Development Socket Programming 12 Two basic approaches to network communication „ The designer invents entirely new procedures calls that applications use to access TCP/IP. „ Windows uses this method. „ The designer attempts to use conventional I/O calls to access TCP/IP. „ Unix uses this method
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有