[Qt-interest] A server/client with Qt

Scott Aron Bloom Scott.Bloom at sabgroup.com
Sun May 31 12:58:54 CEST 2009


Please respond to the list.. not to me personally…

 

It comes up about once every 6 months or so.. maybe more…


Where people put a TCP system one for each connection into an individual thread, so that “its non blocking” to the main system…  Then they use the blocking calls to the TCP classes.

 

Its simply not necessary, yet people still do it.


Scott

 

From: Bahadır Doğan [mailto:abahadirdogan at gmail.com] 
Sent: Sunday, May 31, 2009 3:57 AM
To: Scott Aron Bloom
Subject: Re: [Qt-interest] A server/client with Qt

 

I didn't understand what you mean with this actually.

May you please explain your sentence,"The biggest mistake is putting a thread around the TCP socket classes..."?

Thanks very much.

 

On Sun, May 31, 2009 at 12:01 PM, Scott Aron Bloom <Scott.Bloom at sabgroup.com> wrote:

You are correct.. QHttp is for client side... However, its being
deprecated for the QNetworkAccessManager... Please look at that code
area...

And yes... the simple Http Server example that's provided in the
examples is a VERY VERY good way to do a server side..

The biggest mistake is putting a thread around the TCP socket classes...
Its just not necessary since the network calls are nonblocking (using OS
specific best implementations (usually a thread hidden from you))


Good luck.. shouldn't be too hard:)

Scott




-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Aleksandar Lazic
Sent: Sunday, May 31, 2009 1:46 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] A server/client with Qt

Dear List,

I want to write a sever/client based tool and yust want to get some
knowledge from the more experienced Qt developer than I'am, due to the
fact that I'am a beginner with the Qt Library.

The application must run on Windows, Linux and Mac, thats the reason why
I decide to go with Qt.

I also must use some dlls from a 3rd party company, which is, for now,
only available under windwos.

I have seen the QHttp* classes but this looks to me that this classes
was designed for 'client' then for server, I'am right?

I thought about to use the

http://www.qtsoftware.com/products/appdev/add-on-products/catalog/4/Util
ities/qtservice/ <http://www.qtsoftware.com/products/appdev/add-on-products/catalog/4/Util%0d%0aities/qtservice/> 

There is a 'very simple' http-server and this is based on QTcpServer, is
this the 'best' way?

I thought to use the QCoreApplication for the server part and
QApplication for the GUI part. The communication will be done over
tcp-socket.

I plan to use some messaging libs, maybe someone have a good experienced
with a lib for/from Qt?

Maybe

http://www.zeromq.org/
or AMQP
http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol

Maybe someone hade some 'pitfalls' which he/she want to share so that I
don't fall in there ;-)

Many thanks for your help

Aleksandar Lazic
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090531/e8bead71/attachment.html 


More information about the Qt-interest-old mailing list