找回密码
 立即注册
socket上用Talktomeand | 家庭/个人应用 2022-08-26 54 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
平台和编译器这篇文章中的大多数代码都在一台LinuxPC上用GNU的gcc成功编译过。而且他们在一台HPUX上用gcc也成功编译过。但是注意,并不是每个代码片段都独立测试过。--------------------------------------------------------------------------------目录:什么是套接口?Internet套接口的两种类型网络理论struct--要么理解他们,要么等异形入/侵地球ConverttheNatives!IP地址和如何管理他们socket()--得到文件描述符!bind()--大家在哪个端口?connect()--Hello!listen()--有人给我打电话吗?accept()--Thankyouforcallingport3490.send()和recv()--Talktome,baby!sendto()和recvfrom()--Talktome,DGRAM-styleclose()和shutdown()--滚开!getpeername()--你是谁?getH/OSTname()--我是谁?DNS--你说“白宫”,我说198.137.240.100客户-服务器背景知识简单的服务器简单的客户端数据报Socket阻塞select()--多路同步I/O,酷!参考资料DisclaimerandCallforHelp

(Platforms and Compilers Most of the code in this article was compiled successfully with GNU's gcc on a Linux PC. And they have successfully compiled with gcc on an HPUX. Note, however, that not every code snippet has been independently tested. -------------------------------------------------- ------------------------------Contents: What is a socket? Two types of network theory structs for Internet sockets--either understand them, or wait for aliens to invade/invade the earth ConverttheNatives! IP addresses and how to manage them socket()--get file descriptors! bind()--Which port are you on? connect()--Hello! listen() -- is someone calling me? accept()--Thankyouforcallingport3490.send() and recv()--Talktome, baby!sendto() and recvfrom()--Talktome, DGRAM-styleclose() and shutdown()--Go away! getpeername()--who are you? getH/OSTname()--Who am I? DNS--You said "White House", I said 198.137.240.100 Client-Server Background knowledge Simple server Simple client datagram Socket blocking select()--multi-channel synchronous I/O, cool! ReferencesDisclaimerandCallforHelp)

[下载]14134778234.rar




上一篇:用Java实现断点续传【经典】
下一篇:用.NET中的socket实现文件传输【精讲,带案例】