Results 1 to 9 of 9

Thread: QTcpServer::incomingConnection ( int socketDescriptor )

  1. #1
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTcpServer::incomingConnection ( int socketDescriptor )

    I can't understand this function ,especially socketDescriptor. what I can do.

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer::incomingConnection ( int socketDescriptor )

    Hi,

    Create a Socket passing this value to it. Think on that is an identifier.
    Òscar Llarch i Galán

  3. #3
    Join Date
    May 2010
    Location
    slovakia
    Posts
    47
    Thanks
    10
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Maemo/MeeGo

    Default Re: QTcpServer::incomingConnection ( int socketDescriptor )

    this function is spawned when client connects to server, thus 'incoming Connection'... socket descriptor is just indetificator of socket, nothing else (because you can have more-than-one clients connected)...

  4. #4
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer::incomingConnection ( int socketDescriptor )

    thank you for you reply. now,I meet a question,I want server to receive message from many clients. using the thread.
    this QTcpServer::incomingConnection can help me do this work?

  5. #5
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer::incomingConnection ( int socketDescriptor )

    Hi,

    You can create on thread every time "incomingConnection" is called.
    But the question is, do you really need threads?
    Òscar Llarch i Galán

  6. The following user says thank you to ^NyAw^ for this useful post:

    insert (8th September 2010)

  7. #6
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer::incomingConnection ( int socketDescriptor )

    have you other methor ?

  8. #7
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QTcpServer::incomingConnection ( int socketDescriptor )

    Quote Originally Posted by insert View Post
    have you other methor ?
    Yes, do not use any blocking functions.

  9. #8
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer::incomingConnection ( int socketDescriptor )

    it maybe troublesome. ok,I will do it in my methor. thank you!

  10. #9
    Join Date
    Sep 2010
    Posts
    12
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer::incomingConnection ( int socketDescriptor )

    at last ,I I finally got the question!

Similar Threads

  1. Replies: 1
    Last Post: 4th February 2009, 01:53
  2. QTcpServer and GDB
    By baray98 in forum Qt Programming
    Replies: 2
    Last Post: 21st January 2009, 08:02
  3. Qtcpserver problem
    By kingslee in forum Qt Programming
    Replies: 3
    Last Post: 3rd September 2008, 18:34
  4. Same port when you pass socketDescriptor?
    By Dumbledore in forum Qt Programming
    Replies: 3
    Last Post: 11th December 2007, 22:03
  5. Replies: 1
    Last Post: 18th June 2006, 10:12

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.