09 2010 档案
《TCP/IP Sockets 编程》笔记7
摘要:第7章 揭密7.4 TCP Socket Life Cycle7.4.1 ConnectingWhen the client calls connect() with the server’s Internet address, W.X.Y.Z, and port, Q, the underlying implementation creates a socket instance;i... 阅读全文
posted @ 2010-09-20 19:13 龍蝦 阅读(422) 评论(0) 推荐(0)
《TCP/IP Sockets 编程》笔记6
摘要:第6章 超越基本的套接字编程6.1 Socket OptionsThe functions getsockopt() and setsockopt() allow socket option values to be queried and set, respectively.int getsockopt(int socket, intlevel,intoptName,void* optVal, ... 阅读全文
posted @ 2010-09-13 23:46 龍蝦 阅读(463) 评论(0) 推荐(0)
《TCP/IP Sockets 编程》笔记1
摘要:第1章 简介计算机网络由通过通信信道互连的机器组成。这些机器称为主机(host)和路由器(router)。主机上运行的应用程序是网络的真正“用户”。路由器又称为网关,负责把信息从一条通信信道中继或转发到另一条通信信道,它们可能运行程序,但通常不会运行应用程序。通信信道(communication channel)是把字节序列从一台主机传送到另一台主机的工具。路由器并不把每一... 阅读全文
posted @ 2010-09-12 21:15 龍蝦 阅读(889) 评论(0) 推荐(0)
《TCP/IP Sockets 编程》笔记2
摘要:第2章 基本的TCP套接字典型的TCP客户通信涉及4个基本步骤:1.使用socket()创建TCP套接字2.使用connect()建立到服务器的连接(需要提供一个sockaddr_in结构)3.使用send()和recv()通信4.使用close()关闭连接TCP是一种字节流协议,这类协议的一种实现是不会保持send()边界。通过在连接一端调用send()发送的字节可能不会通过在另一端单独调用一次recv()而全都返回。编写使用套接字的应用程序的基本原则是:对于网络和另一端的程序将要做什么,永远都不能做假设。This is a basic principle of writing applic 阅读全文
posted @ 2010-09-12 21:13 龍蝦 阅读(402) 评论(0) 推荐(0)
《TCP/IP Sockets 编程》笔记3
摘要:第3章 关于名称和地址族There are a number of ways to resolve names into binary quantities; your system probably provides access to several of these. Some of them involve interaction with other systems “und... 阅读全文
posted @ 2010-09-12 21:11 龍蝦 阅读(440) 评论(0) 推荐(0)
《TCP/IP Sockets 编程》笔记4
摘要:第4章 使用UDP套接字UDP只执行两种功能:1.向IP层添加了另一个寻址(端口)层;2.检测传输中可能发生的数据损坏,并丢弃任何损坏的数据报。UDP套接字与TCP套接字之间的另一个区别在于它们处理消息边界的方式:UDP套接字会保留它们。UDP提供的端到端传输服务时一种“尽力而为”的服务:不保证通过UDP套接字发送的消息将会到达其目的地。Sending and Receiving with UDP Socketsssize_t sendto(int socket, const void *msg, size_t msgLength, int flags, const struct sockad 阅读全文
posted @ 2010-09-12 21:09 龍蝦 阅读(351) 评论(0) 推荐(0)
《TCP/IP Sockets 编程》笔记5
摘要:第5章 发送和接收数据There is nomagic: any programs that exchange information must agree on how that information will be encoded—represented as a sequence of bits—as well as which program sends what... 阅读全文
posted @ 2010-09-11 18:54 龍蝦 阅读(1097) 评论(0) 推荐(0)


点击右上角即可分享
微信分享提示