Sockets not talking on new fedora 21 installation
-
I have a simple socket application that opens and closes a socket on every write. I've been meaning to keep socket open for quite some, and have a proper dialogue set-up, but I've had other priorities...
It no longer works on my new fedora 21 installation, which had problems itself, and required me to use the SELinux troubleshooter to permit network-manager access to certain files during the DSL set up.
Through the bugger I see that I have connected to my remote application and that the write has succeeded. On the receiving application, the qt-creator debugger does not break at the event loop.
Using NetActView ( which I am new to ) , I observe the recieving port in a CLOSE_WAIT state:
tcp6 xxxxx CLOSE_WAIT ::ffff:127.0.0.1 44484 localhost.localdomain
Any clues as to what is wrong? Something is wrong with my OS setup, is my guess, since the code has beeen in use for years.
-
that was my 1st look . Now that things have settled down, I've taken a closer look.
The QT appliccation succeeds on all write operations, although I notice the library returns errors in some cases ( write ) but not others: for instance connectToHost, which uses signals, and the state(). I added code to check the states & everything is fine, they move from 0 (unconnected) to 2 (connecting) to 3 (connected). The write returns the correct number of bytes and the socket disconnects.
IF I break it at the write point I see this netstat
tcp 32863 ESTABLISHED 127.0.0.1 26919 localhost 6007 send
tcp6 26919 ESTABLISHED ::ffff:127.0.0.1 32860 localhost.localdomain 5850 clangbut the recieving process does not break at event(), nor incomingConnection()
After the write and disconnect, the sending port goes into a TIME_WAIT and the receiver goes into CLOSE_WAIT
-
slightly oops, the local port on line one should match the remote port on line two, the exmple was glued to from two runs of the program, an actual case would look like this:
tcp 32925 ESTABLISHED 127.0.0.1 26919 localhost 6265 send
tcp6 26919 ESTABLISHED ::ffff:127.0.0.1 32925 localhost.localdomain 6245 clang