QT Version: 4.5.1
Compiler: mingw32-g++.exe (GCC) 3.4.2 (mingw-special) - the version that came with QT
Platform: Currently Windows, but the development has to be portable to Linux (xUbuntu)
My situation is that I am developing an application using QT and I need to set-up several links to external devices. The platform we are using has 2 ethernet interfaces and there appears to be no way to bind a QTcpSocket to a specific local interface when creating a connection.
I am really looking for confirmation of this and that if I really want to bind to a specific interface it appears that my only option is to create a subclass of QTcpSocket that has a method that makes so decidedly hacky and non-forward compatible calls to the underlying socket engine class (in the same way that QUdpSocket binds to an interface).
As I have been writing this post I am getting a growing awareness that actually the platform routing table in the network stack should take care of binding to the correct interface given the destination IP. Or at least it should if the 2 networks were completely separate but that is related to some network architecture problems which is another issue that I need to resolve for this project but really not your problem at all
Cheers
Banfa
Bookmarks