- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
SSD 计算机网络 PPT Chapter2
Socket-programming using TCP Socket: a door between application process and end-end-transport protocol (UCP or TCP) TCP service: reliable transfer of bytes from one process to another process TCP with buffers, variables socket controlled by application developer controlled by operating system host or server process TCP with buffers, variables socket controlled by application developer controlled by operating system host or server internet Application 2-* Socket programming with TCP Client must contact server server process must first be running server must have created socket (door) that welcomes client’s contact Client contacts server by: creating client-local TCP socket specifying IP address, port number of server process when client creates socket: client TCP establishes connection to server TCP when contacted by client, server TCP creates new socket for server process to communicate with client allows server to talk with multiple clients source port numbers used to distinguish clients (more in Chap 3) TCP provides reliable, in-order transfer of bytes (“pipe”) between client and server application viewpoint Application 2-* Client/server socket interaction: TCP wait for incoming connection request connectionSocket = welcomeSocket.accept() create socket, port=x, for incoming request: welcomeSocket = ServerSocket() create socket, connect to hostid, port=x clientSocket = Socket() close connectionSocket read reply from clientSocket close clientSocket Server (running on hostid) Client send request using clientSocket read request from connectionSocket write reply to connectionSocket TCP connection setup Application 2-* Client process client TCP socket Stream jargon stream is a sequence of characters that flow into or out of a process. input stream is attached to some input source for the process, e.g., keyboard or socket. output stream is attached to an output source, e.g., monitor or socket. Application 2-* Socket programming with TCP Example client-server ap
您可能关注的文档
最近下载
- 牙合架、面弓 培训专用.ppt VIP
- 谐音背单词联想记忆七天背完高中单词打印版.docx VIP
- 八年级语文上册新教材解读课件(统编版2024).pptx
- 建设工程监理质量管理体系技术和档案管理制度汇编样本.doc
- GB 30251-2024 炼化行业单位产品能源消耗限额.pdf VIP
- 香精香料基本知识培训课件.pptx VIP
- 《中华优秀传统文化》教案 第16课 商贸文化.docx VIP
- Unit 5(第1课时 Section A 1a-1d)(教学设计)七年级英语上册(人教版2024).pdf VIP
- 人教版中考英语单词巧记妙背三(单词句子图片结合记忆)课件.pptx VIP
- 第6课 从小爱科学 第1课时(教学设计)2025统编版道德与法治三年级上册.pdf
文档评论(0)