您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 基于TCP协议的简单即时通信软件的设计与实现
毕业设计(论文)基于TCP协议的数据网络通信设计系别:信息技术系专业名称:通信技术学生姓名:李芳学号:2009513230指导教师:周燕完成日期2012年4月西安科技大学高新学院毕业论文(设计)21基于TCP协议的简单即时通信软件的设计与实现摘要即时通信(InstantMessage),由于其具有实时性、跨平台性、成本低、效率高等优点而受到广泛的使用。设计并实现一个能够处理多用户进行实时、安全的即时通信系统具有较强的现实意义。即时通信的底层通信是通过SOCKET套接字接口实现的。当前的主流UNIX系统和微软的WINDOWS系统都在内核提供了对SOCKET字接口的支持。使用这个统一的接口,可以编写一个可移植的TCP/IP通信程序。使信息能够在INTERNET上可靠的传输。本文设计并实现了基于局域网内的简单即时通信系统,系统采用C/S模式,底层通信通过SOCKET套接字接口实现,服务器负责客户端的登录验证,好友信息的保存和心跳报文的发送。客户端采用P2P方式实现消息传递,并能实现文件的传输。本文首先讨论了同步套接字,异步套接字,多线程并发执行任务等;然后阐述了客户端、服务器如何使用XML序列化的消息进行通信。关键词:即时通信;文件传输;套接字;TCP协议西安科技大学高新学院毕业论文(设计)22TheDesignandImplementationofSimpleInstantMessageSoftwareBasedonTCPProtocolAbstractInstantmessageshaveseveraladvantagessuchasreal-time,cross-platform,cheapandefficient.TodesignaMulti-userIM(instantmessage)architectureisveryimportantinboththeoryandrealism.InstantmessagebasedonTCP/IPprotocolthatisrealizedbysocketinterface.AlmostallUNIXoperationsystemsandMicrosoft'swindowsoperationsystemsprovidesupportofsocketinthekernel.Usingtheuniforminterface,wecandevelopaportableprogramofTCP/IP,whichhelpustransferinformationinInternetsafelyandcredibly.Thesystemusestheclient/server(C/S)mode.Theservertakestheresponsibilityoftheloginmessageofclient,thesavingoffriendmessageandMessageheartbeat.ThetransmissionofthebasicmessagesofthecustomerendwillbedesignedonP2Parchitecture.ThisthesisexplainshowtheclientandservercommunicateviaserializingXMLmessage.Keywords:InstantMessage;FileTransfer;Socket;TCPprotocol基于TCP协议的简单即时通信软件的设计与实现.doc西安科技大学高新学院毕业论文(设计)23目录1引言.............................................................................................................................................11.1课题背景.................................................................................................................................12相关技术介绍.............................................................................................................................12.1.NET开发平台及C#.NET开发语言....................................................................................12.2TCP协议..................................................................................................................................22.2.1TCP/IP网络协议............................................................................................................22.2.2TCP——传输控制协议...................................................................................................22.3套接字.....................................................................................................................................32.4流.............................................................................................................................................32.4.1流的基本概念.................................................................................................................32.4.2.NET中的流....................................................................................................................32.5同步、异步、阻塞和非阻塞.................................................................................................42.6C/S模型..................................................................................................................................42.7即时通信协议.........................................................................................................................53系统总体设计.............................................................................................................................53.1需求分析.................................................................................................................................53.2系统基本架构.........................................................................................................................63.3功能模块设计.........................................................................................................................63.4逻辑图.....................................................................................................................................83.5数据库设计.............................................................................................................................83.5.1实体关系图.....................................................................................................................83.5.2详细列表.........................................................................................................................94系统实现...................................................................................................................................104.1使用XML定义的即时通信协议...........................................................................................104.1.1信息结构MESSAGE.CS&UMESSAGE.CS...............................................................104.1.2数据结构FriendStruct..............................................................................................104.2数据库连接类.......................................................................................................................104.3服务器端....................
本文标题:基于TCP协议的简单即时通信软件的设计与实现
链接地址:https://www.777doc.com/doc-5916586 .html