文件名称:net_server11
- 所属分类:
- Internet/网络编程
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2013-03-28
- 文件大小:
- 19.53mb
- 下载次数:
- 0次
- 提 供 者:
- hej***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
QT TCPSERVER多线程服务器本文参考了http://mobile.51cto.com/symbian-272733_1.htm和http://mobile.51cto.com/symbian-268690_1.htm两篇好文章,这个两篇文章各有不足,第一篇
解释QThread线程工作的原理,但是没有具体直观的多线程实例,第二篇则给出了多线程服务器端建立的实例,但是多线程并没有真正的在不同的线程工作,本文依据第一篇博文,
在第二篇的基础上修改,从debug的结果来看,实现了文件在新线程中运行,真正实现了多线程。代码如下:
多线程服务器端程序-QT TCPSERVER Qthread A QThread object manages one thread of control within the program. To make code run in a separate thread, simply create a QThread, change the thread affinity of the QObject(s) that contain the code, and start() the new event loop. For example:
解释QThread线程工作的原理,但是没有具体直观的多线程实例,第二篇则给出了多线程服务器端建立的实例,但是多线程并没有真正的在不同的线程工作,本文依据第一篇博文,
在第二篇的基础上修改,从debug的结果来看,实现了文件在新线程中运行,真正实现了多线程。代码如下:
多线程服务器端程序-QT TCPSERVER Qthread A QThread object manages one thread of control within the program. To make code run in a separate thread, simply create a QThread, change the thread affinity of the QObject(s) that contain the code, and start() the new event loop. For example:
(系统自动生成,下载前可以参看下载内容)
下载文件列表
net_server\net_server\192.168.1.5.5195
..........\..........\Debug\moc_mainwindow.cpp
..........\..........\.....\moc_tcpserver.cpp
..........\..........\.....\moc_tcpthread.cpp
..........\..........\.....\net_server.exe
..........\..........\.....\net_server.ilk
..........\..........\.....\net_server.pdb
..........\..........\GeneratedFiles\ui_mainwindow.h
..........\..........\ipch\net_server-1c21b47b\net_server-b07dcb8.ipch
..........\..........\main.cpp
..........\..........\mainwindow.cpp
..........\..........\mainwindow.h
..........\..........\mainwindow.ui
..........\..........\net_server.pro
..........\..........\net_server.pro.user
..........\..........\net_server.pro.user.74c9a6b
..........\..........\net_server.sdf
..........\..........\net_server.suo
..........\..........\net_server.vcxproj
..........\..........\net_server.vcxproj.filters
..........\..........\net_server.vcxproj.user
..........\..........\tcpserver.cpp
..........\..........\tcpserver.h
..........\..........\tcpthread.cpp
..........\..........\tcpthread.h
..........\..........\Win32\Debug\CL.read.1.tlog
..........\..........\.....\.....\CL.write.1.tlog
..........\..........\.....\.....\custombuild.read.1.tlog
..........\..........\.....\.....\custombuild.write.1.tlog
..........\..........\.....\.....\link.read.1.tlog
..........\..........\.....\.....\link.write.1.tlog
..........\..........\.....\.....\main.obj
..........\..........\.....\.....\mainwindow.obj
..........\..........\.....\.....\moc_mainwindow.obj
..........\..........\.....\.....\moc_tcpserver.obj
..........\..........\.....\.....\moc_tcpthread.obj
..........\..........\.....\.....\mt.read.1.tlog
..........\..........\.....\.....\mt.write.1.tlog
..........\..........\.....\.....\net_server.exe.intermediate.manifest
..........\..........\.....\.....\net_server.lastbuildstate
..........\..........\.....\.....\net_server.log
..........\..........\.....\.....\tcpserver.obj
..........\..........\.....\.....\tcpthread.obj
..........\..........\.....\.....\vc100.pdb
..........\..........-build-桌面-Debug\debug\main.o
..........\...........................\.....\mainwindow.o
..........\...........................\.....\moc_mainwindow.cpp
..........\...........................\.....\moc_mainwindow.o
..........\...........................\.....\moc_tcpserver.cpp
..........\...........................\.....\moc_tcpserver.o
..........\...........................\.....\moc_tcpthread.cpp
..........\...........................\.....\moc_tcpthread.o
..........\...........................\.....\net_server.exe
..........\...........................\.....\tcpserver.o
..........\...........................\.....\tcpthread.o
..........\...........................\Makefile
..........\...........................\Makefile.Debug
..........\...........................\Makefile.Release
..........\...........................\ui_mainwindow.h
..........\..........\ipch\net_server-1c21b47b
..........\..........\Win32\Debug
..........\..........\Debug
..........\..........\GeneratedFiles
..........\..........\ipch
..........\..........\Release
..........\..........\Win32
..........\..........-build-桌面-Debug\debug
..........\...........................\release
..........\net_server
..........\net_server-build-桌面-Debug
net_server