Results 1 to 12 of 12

Thread: Socket + thread problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Socket + thread problem

    Quote Originally Posted by borisbn View Post
    ok, if you will not start the thread, then you will not process events in it. In your example ( but without moveToThread ) events will be processed in main thread, but topic starter ( if I understand correctly ) wanted to process events in separate thread. To do this hi should move objects, that generates events, to that tread. I suggested to move whole object Thread to thread. In this way all it's children will be it thread.
    There are two things here:
    1. Why move the QThread object to another thread instead of creating a separate object and moving THAT to the thread or better yet creating that object in the thread itself?
    2. Why move the QThread object to another thread before the thread is actuallys started?

    There is also point 3:
    - Why use threads here at all?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    May 2010
    Posts
    46
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Socket + thread problem

    Ok, I think that I have solve my problem. I have use the first replay of tbscope that is the same that I have read here:

    http://labs.trolltech.com/blogs/2010...doing-it-wrong

    I think that thread's implementations isn't clear, for example if you read " Threaded Fortune Server Example" you can see that FortuneServer subclass QThread and it can be create confusion.

    thanks all fro the replay,

    See you, Dax

Similar Threads

  1. socket & thread
    By prashant in forum Qt Programming
    Replies: 2
    Last Post: 2nd December 2009, 10:09
  2. thread with socket?
    By triperzonak in forum Qt Programming
    Replies: 6
    Last Post: 25th September 2008, 16:21
  3. Socket on a Thread
    By ^NyAw^ in forum Qt Programming
    Replies: 2
    Last Post: 7th May 2008, 15:56
  4. Thread, Timer and Socket. Comuication problem
    By ^NyAw^ in forum Qt Programming
    Replies: 6
    Last Post: 17th January 2008, 16:48
  5. How to write on a socket in another thread?
    By Valheru in forum Qt Programming
    Replies: 7
    Last Post: 12th October 2006, 10:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.