- 1
- 0
- 约1.67万字
- 约 27页
- 2017-08-11 发布于安徽
- 举报
TCP协议下的即时通讯软件的实现
摘 要
即时通(Instant Message),实时性、跨平台性、成本低、效率高等优点一个能够处理户进行实时、安全的即时通具有较强的现实意义。即时的底层通过SOCKE字接口实现。当前的主流UNIX系统和微软的WINDOWS系统都在内核提供了对SOCKET字接口的支持。使用这个统一的接口,可以编写一个可移植的TCP/IP程序。使信息能够在INTERNET上可靠的传输。
The Design and Implementation 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 Microsofts 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 Internet safely and credibly.
The system uses the client/server(C/S) mode. The server takes 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 server communicate via serializing XML message.
Key words: Instant Message; File Transfer; Socket; TCP protocol
目 录
论文总页数:28页
1 引言 1
1.1 课题背景 1
1.2 国内外研究现状 1
1.2.1 国外研究现状 1
1.2.2 国内研究现状 2
1.3 本课题研究的意义 2
1.4 本课题的研究方法 2
2 相关技术介绍 2
2.1 .NET开发平台及C#.NET开发语言 2
2.2 TCP协议 3
2.2.1 TCP/IP网络协议 3
2.2.2 TCP——传输控制协议 3
2.3 套接字 4
2.4 流 4
2.4.1 流的基本概念 4
2.4.2 .NET中的流 4
2.5 同步、异步、阻塞和非阻塞 5
2.6 C/S模型 5
2.7 即时通信协议 6
3 系统总体设计 7
3.1 需求分析 7
3.2 系统基本架构 7
3.3 功能模块设计 7
3.4 逻辑图 9
3.5 数据库设计 10
3.5.1 实体关系图 10
3.5.2 详细列表 10
4 系统实现 11
4.1 使用XML定义的即时通信协议 11
4.1.1 信息结构MESSAGE.CSUMESSAGE.CS 11
4.1.2 数据结构FriendStruct 12
4.2 数据库连接类 14
4.3 服务器端 15
4.3.1 同步套接字网络监听 15
4.3.2 多线程 19
4.3.3 计时器 19
4.4 客户端 20
4.4.1 同步套接字客户端 20
4.4.2 采用异步套接字的文件传输 23
结 论 25
参考文献 26
引言
课题背景
即时通信是一个终端连往一个即时通信网路的服务。即时通信不同于e-mail在于它的交谈是实时的。大部分的即时通信服务提供了presence awareness的特性──显示联络人名单,联络人是否在在线与能否与联络人交谈。
最早的即时
原创力文档

文档评论(0)