Welcome![Sign In][Sign Up]
Location:
Search - TCP Visual

Search list

[WinSock-NDISTCP实现客户服务器聊天程序

Description:

 

操作系统课程设计任务书


一、设计题目:多机进程通信

应用Socket进程通信技术编写聊天室程序,实现基于服务器的并发多机信息转发。如果各客户端在线则可以实时聊天、发送接收文件,如果某客户端离线,则发送给他的消息可由服务器端进行内容缓存,待重新连线后可以自动接收通过服务器转发的信息或文件。缓存与转发的控制算法可参考操作系统课程中生产者消费者进程同步方法、缓冲池技术等相关理论。
二、设计思路和功能的详细描述
采用TCP协议,所以属于客户机/服务器模式,因此需要聊天服务器端和聊天客户端两个程序,实现的功能是:任意一台装有客户端程序的计算机都可以通过服务器端的IP地址与服务器相连,然后进入聊天室与连接到服务器的其他客户进行聊天。当客户聊天结束时,可以点断开与服务器断开连接,以释放进程让其他等待的客户进入聊天室,本聊天室最大同时支持50个客户端的连接,如果服务器配置较高可以修改程序来增加同时连接数。
三、采用的方法、技术、运行环境及其配置
本聊天程序采用TCP协议,用VC++编写,属于客户机/服务器模式。采用了多线程的机制。其中使用windows Sockets实现多台计算机(多个进程)间的通信,SOCKET实际在计算机中提供了一个通信端口,可以通过这个端口与任何一个具有SOCKET接口的计算机通信。应用程序在网络上传输,接收的信息都通过这个SOCKET接口来实现。客户机/服务器模式中客户应用程序向服务器程序请求服务。一个服务程序通常在一个众所周知的地址监听对服务的请求,也就是说,服务进程一直处于休眠状态,直到一个客户对这个服务的地址提出了连接请求。在这个时刻,服务程序被“惊醒”并且为客户提供服务即对客户的请求作出适当的反应。本聊天程序就是基于这中思想实现的,程序分为两大部分:TCP聊天服务器端和TCP聊天客户端。两者都拥有各自的SOCKET接口,其中服务器端SOCKET接口需要绑定到固定地址上(实现语句:ock=Socket(AF_INET,SOCK_STREAM,0);),等待客户端的连接(实现语句:listen(sock,5);)。等待客户端的连接的过程就是通过多进程机制来实现的。
聊天程序是在VISUAL C++6.0上编译实现的,在WINDOWS2000,XP上测试运行成功。
对客户计算机配置无特殊要求,由于所设置的最大连接进程为50,所以对服务器要求也不高。
四、关键源程序及其详细的注释
<一>、服务器端
1
、Socket初始化
//
初始化对话框
BOOL CCSocketDlg::OnInitDialog()
{

count=0;

m_list.InsertColumn(0,"消息");

m_list.SetColumnWidth(0,435);

m_edit.SetLimitText(99);

.

.

.

.

 


Platform: | Size: 55808 | Author: lenjear | Hits:

[BooksTcp-ip原理

Description: Tcp-ip原理.doc-DEC- ip principle. Doc
Platform: | Size: 71680 | Author: 黄盈鑫 | Hits:

[Internet-NetworkTCP网络传输

Description: TCP网络传输,使用socket开发,基本的东西都已经具备,没有漂亮的界面,用vc开发-TCP net transfer develops through socket,with the basic stuff provided,without beautiful interface. It is developed by VC.
Platform: | Size: 71680 | Author: 杨智 | Hits:

[Internet-NetworkTCP服务器端MANK

Description: 一个TCP/IP的服务器端,但是增加了列表显示以及对客户端标示管理!-A TCP/IP server program with list display and client management
Platform: | Size: 48128 | Author: | Hits:

[SCMtcpip_reder

Description: TCP/IP考勤读卡器的VB例程,内容非常全面。-TCP/IP attendance reader VB routines, as very comprehensive.
Platform: | Size: 109568 | Author: 郝东 | Hits:

[Internet-NetworkCommunicationbylqh

Description: 基于Socket TCP的网络文件传输例子,比较精练,简单易懂,对网络编程入门者有参考作用。-based on Socket TCP network file transfer example, more concise and easily understood. Network Programming for beginners as a useful reference.
Platform: | Size: 3897344 | Author: Lqh | Hits:

[TCP/IP stackALARMSERVER

Description: VB写的基于TCP/IP写的SOCKET通信程序 用于车辆监控的报警方案管理-VB was based on TCP/IP Socket Communications written procedures for the police vehicle monitoring program management
Platform: | Size: 273408 | Author: 摄氏37度 | Hits:

[TCP/IP stackTcpFileTransferDemo

Description: Visual Studio 2005环境下,采用C#语音编写的Tcp协议下的文件传送的示例程序。-Visual Studio 2005 environment, using C# Voice Tcp agreement prepared under the example of file transfer procedures.
Platform: | Size: 191488 | Author: 筱凌 | Hits:

[TCP/IP stackTCP.UDP

Description: Visual C++网络通信协议分析之TCP.UDP高级编程.-Visual C++ Network communication protocol analysis TCP.UDP high-level programming.
Platform: | Size: 69632 | Author: Steven | Hits:

[TCP/IP stackvctcpip

Description: vc6.0 tcp/ip客户端服务器端接收发送程序-vc6.0 tcp/ip client server-side program to receive send
Platform: | Size: 3539968 | Author: 木百 | Hits:

[assembly languageTCP

Description: 扫描TCP端口是入侵者搜集目标主机开放端口的常用手法之一,而多线程的扫描能大大加快扫描速度。设置要扫描的起始IP和结束IP,开对应IP主机端口是否回复来证明是否开放-TCP port scan is a collection of target host intruder port open one of the common practices, and multi-threaded scanning can greatly speed up the scanning speed. Set up to scan the beginning of the end of IP and IP, to open the corresponding IP host port is back to prove whether the open
Platform: | Size: 137216 | Author: lzd | Hits:

[Internet-Network322

Description: tcp并发服务器,可以同时接受多个客户端的服务请求-tcp concurrent server can accept multiple clients at the same time the service request
Platform: | Size: 555008 | Author: 刘晖 | Hits:

[Internet-NetworkTCP_Socket

Description: tcp的基于事件模型的封装,只需将CSocket类包含就可以,使用简单。-a wrap of tcp base on event i/o model
Platform: | Size: 608256 | Author: huitetong | Hits:

[Internet-NetworkMFC_ChatRoom_WINSOCK-TCP

Description: MFC开发的聊天室,有server和client 支持多人聊天 适合MFC开发者学习和使用- a chat room developed in mfc support multi_person chating
Platform: | Size: 1657856 | Author: 田杰 | Hits:

[CSharpcsharpfr_SERVEUR-ESCLAVE-MODBUS-TCP-IP___Page

Description: This server / ModBus slave simulates equipment communicating with the ModBus protocol on a TCP / IP as a controller for example. It responds to requests from a master / client. I used ModScan32 and a monitoring software that I developed in my company for testing. Some details: - 4 tables of data are scaled to 200 items each (constant chosen arbitrarily) and values of each item (bit / register) can be modified in the cell corresponding - Responses to requests functions 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x10, 0x0F - Return management of exceptions ModBus started but complete - Visual refresh table data after a write request to complete The software is not finalized and has been tested only in certain configurations, it must contain some bugs. If you detect inconsistencies vis-à-vis the protocol, please let me know (I have some issues that differ among the PDF and found the software testing as ModScan32). Development in Visual Studio. NET 2008.-This server/ModBus slave simulates equipment communicating with the ModBus protocol on a TCP/IP as a controller for example. It responds to requests from a master/client. I used ModScan32 and a monitoring software that I developed in my company for testing. Some details: - 4 tables of data are scaled to 200 items each (constant chosen arbitrarily) and values of each item (bit/register) can be modified in the cell corresponding - Responses to requests functions 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x10, 0x0F - Return management of exceptions ModBus started but complete - Visual refresh table data after a write request to complete The software is not finalized and has been tested only in certain configurations, it must contain some bugs. If you detect inconsistencies vis-à-vis the protocol, please let me know (I have some issues that differ among the PDF and found the software testing as ModScan32). Development in Visual Studio. NET 2008.
Platform: | Size: 60416 | Author: bigui | Hits:

[Communicationmbtcp

Description: A sample project use Modbus TCP protocol. This is can connect to all of Modbus TCP devices
Platform: | Size: 22528 | Author: kheo | Hits:

[CommunicationVB_ModbusDll

Description: Simple demo of Modbus/tcp in VB
Platform: | Size: 53248 | Author: Andrew Clayton | Hits:

[JSP/Javatcp-communication

Description: 基于TCP协议的通信系统,可实现两个计算机之间的通信,有可视界面。-TCP protocol based communication system that enables communication between two computers, there are visual interface.
Platform: | Size: 2680832 | Author: nupt2006 | Hits:

[TCP/IP stackCS-TCP

Description: Visual C sharp TCP socket 编程-Visual C sharp TCP socket
Platform: | Size: 1024 | Author: tjh | Hits:

[TCP/IP stackclient&server

Description: 服务器端和客户端,基于tcp的传输协议,使用openssl库进行开发,其中已经生成了证书和密钥文件(下载openssl库可生成)(The server and client, transmission protocol based on TCP, using the OpenSSL library, which have generated the certificate and key file (download OpenSSL can be generated))
Platform: | Size: 63160320 | Author: 蹦蹦慧 | Hits:
« 12 3 4 5 6 7 8 9 10 ... 15 »

CodeBus www.codebus.net