›› 2015, Vol. 28 ›› Issue (3): 76-.

• 论文 • 上一篇    下一篇

基于Qt的一个服务器多个客户端的TCP通信

黄翩,张琼,祝婷   

  1. (西安电子科技大学 电子信息攻防对抗与仿真重点实验室,陕西 西安 710071)
  • 出版日期:2015-03-15 发布日期:2015-03-12
  • 作者简介:黄翩(1990—),女,硕士研究生。研究方向:雷达信号环境模拟器,基于Qt的界面编程。E-mail:920918193@qq.com。张琼(1990—),女,硕士研究生。研究方向:雷达系统建模与仿真。祝婷(1990—),女,硕士研究生。研究方向:软件程序开发。

TCP Communications of One Sever to Several Clients Based on Qt

HUANG Pian,ZHANG Qiong,ZHU Ting   

  1. (Ministry of Education Key Laboratory of Electronic Information Countermeasure and Simulation,Xidian University,Xi'an 710071,China)
  • Online:2015-03-15 Published:2015-03-12

摘要:

作为跨平台应用程序和UI开发框架,Qt被越来越多地用于应用程序的开发上。而网络程序又是软件开发的主要内容之一,文中对如何利用Qt开发TCP网络程序进行了研究。通过新建TCPServer类和TCPSocket类,分别继承自Qt里封装好的QTCPServer类和QTCPSocket类,完成服务器和套接字的建立与连接,从而实现了搭建针对多客户端的服务器。

关键词: Qt, TCP, 服务器, 多客户端

Abstract:

As a good cross-platform application and UI development framework,Qt is increasingly used in application development,in which the web application is one of the main aspects.This paper discusses the use of Qt to develop the procedures of TCP network.The server and socket connection are established by using new Qt encapsulated TCPServer class and TCPSocket class inherited from QTCPServer class and QTCPSocket class respectively,so as to realize the set for the server to several clients.

Key words: Qt;TCP;server;several clients

中图分类号: 

  • TN915.04