[Qt-interest] A server/client with Qt

Aleksandar Lazic al-qtinterest at none.at
Sun May 31 15:20:45 CEST 2009


On Son 31.05.2009 02:01, Scott Aron Bloom wrote:
>
>You are correct.. QHttp is for client side... However, its being
>deprecated for the QNetworkAccessManager...  Please look at that code
>area...

Thanks, I have seen it, and the QNetworkAccessManager is also primarly
for client ;-)

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

Ok.

>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))

;-).
Well I like, and use, nginx, haproxy and a lot of other eventbased SW,
this was also one of the reason why have looked into Qt.

Maybe you can answer a curious question for me:

How difficult could i be to combine

libev http://software.schmorp.de/pkg/libev.html

or

libevent 2.0 http://monkey.org/~provos/libevent/

with Qt network / event stack?

What I have seen is that Qt uses the glib, select(), ... for
eventhandling.

### ls -la src/corelib/kernel/*event*
src/corelib/kernel/qabstracteventdispatcher.cpp
src/corelib/kernel/qabstracteventdispatcher.h
src/corelib/kernel/qabstracteventdispatcher_p.h
src/corelib/kernel/qcoreevent.cpp
src/corelib/kernel/qcoreevent.h
src/corelib/kernel/qeventdispatcher_glib.cpp
src/corelib/kernel/qeventdispatcher_glib_p.h
src/corelib/kernel/qeventdispatcher_unix.cpp
src/corelib/kernel/qeventdispatcher_unix_p.h
src/corelib/kernel/qeventloop.cpp
src/corelib/kernel/qeventloop.h
src/corelib/kernel/qwineventnotifier_p.cpp
src/corelib/kernel/qwineventnotifier_p.h
###

Maybe QAbstractEventDispatcher but this is to much for now, just for my
curiousity ;-)

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

Many thanks.

Aleks



More information about the Qt-interest-old mailing list