文档介绍:基于 TCP 协议的简单即时通信软件的设计与实现摘要即时通信(Instant Message) ,由于其具有实时性、跨平台性、成本低、效率高等优点而受到广泛的使用。设计并实现一个能够处理多用户进行实时、安全的即时通信系统具有较强的现实意义。即时通信的底层通信是通过 SOCKE T套接字接口实现的。当前的主流 UNIX 系统和微软的 WINDOWS 系统都在内核提供了对 SOCKET 字接口的支持。使用这个统一的接口,可以编写一个可移植的 TCP/IP 通信程序。使信息能够在 上可靠的传输。本文设计并实现了基于局域网内的简单即时通信系统,系统采用 C/S 模式,底层通信通过 SOCKET 套接字接口实现,服务器负责客户端的登录验证,好友信息的保存和心跳报文的发送。客户端采用 P2P 方式实现消息传递,并能实现文件的传输。本文首先讨论了同步套接字,异步套接字,多线程并发执行任务等;然后阐述了客户端、服务器如何使用 XML 序列化的消息进行通信。关键词: 即时通信;文件传输;套接字; TCP 协议 The Design and I mplementation of Simple Instant Message Software Based on TCP Protocol Abstract Instant messages have several advantages such as real-time, cross-platform, cheap and efficient. To design a Multi-user IM (instant message) architecture is very important in both theory and realism. Instant message based on TCP/IP protocol that is realized by socket interface. Almost all UNIX operation systems and Microsoft's windows operation systems provide support of socket in the kernel. Using the uniform interface, we can develop a portable program of TCP/IP, which help us transfer information in safely and credibly. The system uses the client/server(C/S) mode. The server take s the responsibility of the login message of client, the saving of friend message and Message heartbeat. The transmission of the basic messages of the customer end will be designed on P2P architecture. This thesis explains how the client and municate via serializing XML message. Key words: Instant Message ; File Transfer ; Socket; TCP protocol 目录论文总页数: 28页 1 引言............................................................................................................................................... 1 课题背景................................................................................................................................... 1 国内外研究现状....................................................................................................................... 1 国外研究现状...............................................................