文件名称:chat
- 所属分类:
- Internet/网络编程
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2013-12-28
- 文件大小:
- 3kb
- 下载次数:
- 0次
- 提 供 者:
- 徐*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
模拟qq聊天室。
服务器端:使用TCP协议创建套接字拿到机器的IP地址,选择一个可用的端口号,绑定它们,然后侦听客户端等待套接字连接。在收到客户端的连接请求,创建一个线程来与客户端进行交互。
客户端:类似服务器端,创建一个socket,注意IP和端口号和服务器端的匹配。在发送连接请求,服务器端,输入您的用户名,然后连接服务器时,可以接收其他客户端发送的数据,但他们也可以将数据发送到服务器端,聊天室功能的实现。-Simulated qq chat rooms.
server side: using tcp protocol creates socket to get the IP address of the machine, select an available port number, bind them, and then listen for client-side waiting for the socket connection. Upon receipt of the client-side connection request, create a thread to interact with the client side.
client side: Similar to server-side, to create a socket, note the IP and port number and server-side match. Before sending a connection request on the server side, enter your user name, and then connect server, you can receive the data sent by other client-side, but they can also send data to the server side, the chat room feature is realized.
服务器端:使用TCP协议创建套接字拿到机器的IP地址,选择一个可用的端口号,绑定它们,然后侦听客户端等待套接字连接。在收到客户端的连接请求,创建一个线程来与客户端进行交互。
客户端:类似服务器端,创建一个socket,注意IP和端口号和服务器端的匹配。在发送连接请求,服务器端,输入您的用户名,然后连接服务器时,可以接收其他客户端发送的数据,但他们也可以将数据发送到服务器端,聊天室功能的实现。-Simulated qq chat rooms.
server side: using tcp protocol creates socket to get the IP address of the machine, select an available port number, bind them, and then listen for client-side waiting for the socket connection. Upon receipt of the client-side connection request, create a thread to interact with the client side.
client side: Similar to server-side, to create a socket, note the IP and port number and server-side match. Before sending a connection request on the server side, enter your user name, and then connect server, you can receive the data sent by other client-side, but they can also send data to the server side, the chat room feature is realized.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
chat
....\client.c
....\server.c