服务器编程_2

TCP、UDP编程一般称为Socket套接字编程

2.2 套接字的创建和关闭

原型如下 int socket(int af,int type,int protocol)

结束套接字

int close(int d)

2.3  Blocking 和 Nonblocking

调用特定套接字函数进行数据发送或接收时,等还是不等函数结果

2.4 TCP/IP 三次握手

 

connect 函数原型:

int connect(int s. const struct sock * name , socklen_t namelen)

htons 和inet_addr 函数

 

posted @ 2015-01-03 13:16  珊符  阅读(96)  评论(0编辑  收藏  举报