文档介绍:基于TCP/IP的局域网聊天室的
设计与实现
摘要
随着计算机网络技术的发展,各种各样基于网络的应用也随之诞生,比如基于互联网的信息发布,通信,数据共享等等。局域网的发展也同样迅速。很多政府机构,企业,学校,都是先以一个统一的局域网联结在一起,.因此基于局域网的即时通信工具,就这样应运而生了。所以本文提出了一个更加合理的设计,,用多线程实现不同的并行任务。并进行了人性化的界面设计,使用起来更加简单方便,并且功能十分合理,又易于扩展以及个性化定制。本文通过局域网聊天系统来具体共享内存实现进程间的数据交换,利用windows消息机制实现进程间的同步,两种机制结合使用。局域网聊天室作为一种新型的聊天工具可以提供更为及时、可靠、突破了必须有外界网络接入等优点,具有极其广泛的发展前景。
本文介绍了采用JAVA编程开发局域网聊天系统的一套比较常用的解决方案。采用TCP模式进行文字聊天, 在客户端之间点对点(C/C)的进行。本系统采用典型的C/S(客户端/服务器)的框架模式,在该方案中采用Socket(套接字)原理实现网络通信,最终实现了通过服务器中转的文字聊天、文件传输功能,从而大大降低了程序的开发难度。本系统主要包括登陆、聊天、好友列表和服务器管理几个部分。本系统从需求分析、系统的设计、功能的实现都严格遵循了软件工程设计的思想。
【关键词】Socket;TCP/IP;C/S;局域网聊天室
Abstract
With the development work technology, a variety of Web-based applications also will be the birth, such as -based information release, communications, data sharing, and so on. LAN development is quickly. Many government agencies, businesses, schools, are first linked together in a unified LAN, respectively connected to the , LAN-based instant messaging tool, and thus came into being. In this paper, a more rational design, in WINDOWS platform to achieve integrated in this realization of the client and server in different parallel tasks within a program, multi-threaded. And the design of user-friendly interface, easy to use and very reasonable, and easy expansion and customization. LAN chat system to a specific shared memory data exchange between process and use the windows message mechanism to achieve inter-process synchronization, the two mechanisms used in conjunctionLAN chat room as a new chat tool that can provide the advantages of more timely, reliable, broke the need of work access, has a very wide range of development prospects.
This article describes a JAVA Programming LAN chat system, a mon solution. TCP mode, text chat, peer-to-peer (C / C) between the client. The system uses the framework of a typical C / S (Client / Server) mode, the program using the Socket (socket) the principle munication, and ultimately the t