台北科技大学:《计算机网络》(英文版) NP04 16 Socket API

Socket api Chuan-Ming Liu Computer Science and Information Engineering Spring 2004, NTUT TAIWAN CS旧E.NTUT. TAWAN
CSIE, NTUT, TAIWAN 1 Socket API Chuan-Ming Liu Computer Science and Information Engineering Spring 2004, NTUT TAIWAN

Introduction Loosely specified protocol software interface Interface functionality Conceptual interface specification System calls Two basic approaches to network communication Basic lo functions in linux Using Linux l/o with TCP/IP CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 2 Introduction • Loosely specified protocol software interface • Interface functionality • Conceptual interface specification • System calls • Two basic approaches to network communication • Basic I/O functions in Linux • Using Linux I/O with TCP/IP

Loosely Specified Protocol TCP/IP protocol software resides in Os Routines in os for the interface between the applications and protocol are known as Application Program Interface(APl CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 3 Loosely Specified Protocol • TCP/IP protocol software resides in OS • Routines in OS for the interface between the applications and protocol are known as Application Program Interface (API)

Loosely Specified Protocol TCP/P designers design to operate in a multi-vendor environment avoid choosing any vendor's internal data representation avoid specifying the interface in terms of features available only on a single vendors Os The interface between TCP/IP and application is loosely specified CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 4 Loosely Specified Protocol • TCP/IP designers – design to operate in a multi-vendor environment – avoid choosing any vendor’s internal data representation – avoid specifying the interface in terms of features available only on a single vendor’s OS • The interface between TCP/IP and application is loosely specified

Loosely Specified Protocol Advantages Flexibility Tolerance Disadvantage designer can make the interface details different for each OS CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 5 Loosely Specified Protocol • Advantages – Flexibility – Tolerance • Disadvantage – designer can make the interface details different for each OS

Loosely Specified Protocol Only a few apls exist that permit an application to use TCP/IP protocol UNIX: socket APL, socket interface, or sockets MS Window: window sockets aT&T: acronym TLI CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 6 Loosely Specified Protocol • Only a few APIs exist that permit an application to use TCP/IP protocol – UNIX: socket API, socket interface, or sockets – MS Window: window sockets – AT&T: acronym TLI

TCP/IP Interface Functionality allocate local resources for communication Specify local and remote communication endpoints Initiate a connection(client) Send a datagram(client) Wait for an incoming connection(server) Send or receive data Determine when data arrives Generate urgent data CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 7 TCP/IP Interface Functionality • Allocate local resources for communication • Specify local and remote communication endpoints • Initiate a connection (client) • Send a datagram (client) • Wait for an incoming connection (server) • Send or receive data • Determine when data arrives • Generate urgent data

TCP/IP Interface functionality Handle incoming urgent data Terminate a connection gracefully Handle connection termination from the remote site abort communication Handle error conditions or a connection abort Release local resource when communication finishes CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 8 TCP/IP Interface Functionality • Handle incoming urgent data • Terminate a connection gracefully • Handle connection termination from the remote site • Abort communication • Handle error conditions or a connection abort • Release local resource when communication finishes

Conceptual Interface Specification The conceptual interface defined by the TCP/IP standards does not specify data representations or programming details; it merely provides an example of one possible API that an operation system can offer to application programs that use TCP/IP oS designers are free to implement as long as the functionality holds CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 9 Conceptual Interface Specification • The conceptual interface defined by the TCP/IP standards does not specify data representations or programming details; it merely provides an example of one possible API that an operation system can offer to application programs that use TCP/IP • OS designers are free to implement as long as the functionality holds

System Calls Mechanism that most operating systems use to transfer control between an applications and the operating system procedures Like function calls(for a programmer) CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 10 System Calls • Mechanism that most operating systems use to transfer control between an applications and the operating system procedures • Like function calls (for a programmer)
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 台北科技大学:《计算机网络》(英文版) NP04 15 Client Server model.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 12 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 11 Introduction.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 1 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 0 Network Programming.ppt
- 哈尔滨工业大学:《网络应用开发》英文版 网络开发与应用实验指导书.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter7.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter7-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter6-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter5.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter5-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter4.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter4-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter3.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter3-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter2.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter2-6.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter1new.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter1new-6.pdf
- 台北科技大学:《计算机网络》(英文版) NP04 16 Client Software Design.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 multi proto.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 multi services.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server ex.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server ex con.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 18.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 2 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 20(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 20.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 21(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 22(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 23(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 24(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 27 Mobile ip discussion overview.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 28 Real-Time Transport protocol.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 3 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 4 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 5 Subnetting.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 8 Internet Protocol (IP).ppt