I have a strange problem: I have a list of TcpClients that I need to be notified when one of them disconnects. When each of them is initialized I set their socket to keepalive (setsocketoption, and iocontrol) and there does not seem to be any problem with it (no exceptions).
Than I have a seperated thread that checks each TcpClient the Connected property of their Socket. The problem is that even when the ip is no longer connected (for example I disconnect the network cable) the boolean is still true (connected). I tried changing the code to (socket.available == true) && socket.poll(1, socketMode.selectread) without any change.
A very important remark: The same exact code works with win Xp (the Connected property is false when there is no connection) but does not work with win7 and there are no exceptions.
I am running the program as administrator and I disabled the firewall.
Thank you in advance.