PDA

View Full Version : QTcpServer works with linux clients but not windows



Glenn Denny
6th December 2016, 21:10
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

anda_skoa
7th December 2016, 08:48
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,
_

Glenn Denny
7th December 2016, 16:18
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

anda_skoa
8th December 2016, 15:20
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,
_

Glenn Denny
11th December 2016, 17:03
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.

anda_skoa
12th December 2016, 11:00
I do not have wireshark

Software can be installed. Especially on Linux that is almost trivial.



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?



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.



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.



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,
_

Glenn Denny
12th December 2016, 21:27
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.