本文已被:浏览 1700次 下载 3338次
Received:October 27, 2014 Revised:December 17, 2014
Received:October 27, 2014 Revised:December 17, 2014
中文摘要: 分析了I/O复用模型的原理和特点, 并针对Windows与Linux平台间通信的并发数量不足的问题, 提出在Windows与Linux平台间使用socket(套接字)异步通信的方法. 通信采用客户端/服务器(Client/Server)模型. 在该模型中, 服务器端使用Linux提供的epoll接口, 而客户端使用.NET提供的AsyncCallBack(异步回调)的委托方式构建跨平台的异步通信. 此外, 结合多线程编程方法, 处理socket通信客户端的显示问题. 从观测通信过程来看, 服务器端能够同时接收多个客户端发送的数据并返回数据. 实验结果表明, 在Windows与Linux进行socket异步通信是完全可行的, epoll接口的使用提高了Linux服务器端的并发性, 从而提高了Windows和Linux平台间网络通信的实时性.
Abstract:This article analyses the principle and characteristics of I/O multiplexing models. It uses the socket's asynchronous communication to solve the problem of insufficient number of concurrent when Windows platform communicates with Linux platform. And the whole system adopts Client/Server model to build cross-platform asynchronous communication program. The server uses the epoll model provided by Linux and the client uses the AsyncCallBack provided by.NET to realize the cross-platform asynchronous communication. In addition, the program combines with the multithreading programming method to deal with the display problem of the client. From the observation of communication process, the server can receive data sent by multiple clients in the meantime and return data to them. In conclusion, with the using of the epoll interface, Linux server's concurrency is improved. For this reason, the real-time performance of the network communication between Windows and Linux platforms is also improved.
文章编号: 中图分类号: 文献标志码:
基金项目:
引用文本:
徐克宝,武慧,文艺成.基于Socket的Windows与Linux平台异步通信.计算机系统应用,2015,24(7):232-235
XU Ke-Bao,WU Hui,WEN Yi-Cheng.Asynchronous Communication Between Windows and Linux Platforms Based on Socket.COMPUTER SYSTEMS APPLICATIONS,2015,24(7):232-235
徐克宝,武慧,文艺成.基于Socket的Windows与Linux平台异步通信.计算机系统应用,2015,24(7):232-235
XU Ke-Bao,WU Hui,WEN Yi-Cheng.Asynchronous Communication Between Windows and Linux Platforms Based on Socket.COMPUTER SYSTEMS APPLICATIONS,2015,24(7):232-235