Results 1 to 7 of 7

Thread: QTcpServer works with linux clients but not windows

  1. #1
    Join Date
    Dec 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default QTcpServer works with linux clients but not windows

    I have a simple QTcpServer running on linux that uses the newConnection signal to receive transmissions from a client that I do not control. When the client is on linux, everything works great. When the same information is sent from a client on Windows, the newConnection signal is never thrown on my server. Are there socket options that I need to set? Are there differences in the way linux and windows call a socket that I need to be aware of? Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer works with linux clients but not windows

    Can you clarify a few things:

    - when you are running on Linux, are both programs running on the same machine?
    - when you are running on Windows, are both programs running on the same machine?

    Cheers,
    _

  3. #3
    Join Date
    Dec 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QTcpServer works with linux clients but not windows

    The Server runs on Linux on one host. The client runs on a different host and I do not control that client.
    If they host their client on a Linux box, my server fires the newConnection signal and all is good. If they move their client to Windows, my server does not fire the newConnection signal and all is not good. Thanks

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer works with linux clients but not windows

    Ok, just wanted to check that both clients are on remote machines, i.e. to rule out not listening on the right interface, etc.

    Have you checked networking issues on the client side?

    Does a traffic monitor like wireshark see the incoming connection request?

    Cheers,
    _

  5. #5
    Join Date
    Dec 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QTcpServer works with linux clients but not windows

    I do not have wireshark and I do not control the client, however, the client is a Mirth interface engine. It is able to connect to my server and appears on their side to successfully transmit the messages. If they host their Mirth instance on Linux, however, I do receive their messages. Is there some setting for QTcpServer that needs to be set to accommodate a connection from a Windows box? The client side developer seems to think is has something to do with the way Windows does carriage return line feeds but I think it is lower level than that because I do not even get to the point where I read the message because the newConnection signal is never fired.

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer works with linux clients but not windows

    Quote Originally Posted by Glenn Denny View Post
    I do not have wireshark
    Software can be installed. Especially on Linux that is almost trivial.

    Quote Originally Posted by Glenn Denny View Post
    It is able to connect to my server and appears on their side to successfully transmit the messages.
    This is a contradiction to "the client cannot connect".
    Or are you talking about the Linux client?

    Quote Originally Posted by Glenn Denny View Post
    Is there some setting for QTcpServer that needs to be set to accommodate a connection from a Windows box?
    No, this is TCP. It doesn't care which operating system, hardware architecture, byte order, etc. each side runs on.

    Quote Originally Posted by Glenn Denny View Post
    The client side developer seems to think is has something to do with the way Windows does carriage return line feeds
    That would obviously only affect transmission of data, not connection, and also be a matter of the application level protocol as TCP is only a byte stream.

    Quote Originally Posted by Glenn Denny View Post
    but I think it is lower level than that because I do not even get to the point where I read the message because the newConnection signal is never fired.
    Exactly. Application level data is above TCP data and data transmission comes after connection, so it doesn't even matter yet at that point in time.

    Given that your end of the connection is the same on both cases and etablishing a connection works when the client runs on Windows, it would be prudent to first rule out a problem there before going on a wild goose chase.

    Ideally the client developers would verify that the connection request has indeed left their system, but if they have no clue you should at least verify if you are seeing it on your network side.

    Cheers,
    _

  7. #7
    Join Date
    Dec 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QTcpServer works with linux clients but not windows

    It is when the client is on Windows that I have the issue. If the client is on Linux it works great. It is certainly not a QT issue as the same thing happens when the server is a java program. It is a client issue and I will get with their developers to try and solve it. Thanks for all of your help and input.

Similar Threads

  1. QTcpServer--cleaning up when clients disconnect
    By davethomaspilot in forum Qt Programming
    Replies: 3
    Last Post: 2nd March 2015, 12:29
  2. Slow QTcpServer with lots of simultaneous clients
    By Mechan in forum Qt Programming
    Replies: 1
    Last Post: 29th April 2012, 10:11
  3. QTcpServer with threaded clients problem
    By Witek in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2011, 22:10
  4. Extend QTcpServer to handle multiple clients
    By DiamonDogX in forum Qt Programming
    Replies: 5
    Last Post: 24th February 2010, 19:49
  5. Replies: 4
    Last Post: 23rd May 2008, 09:42

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.