J
Joe
Hi,
I browsed the news and a few seem to have this problem too, but no
solution !
I have a client server application where in case the connection gets bad
(crashes or whatever) client or server (who knows it first) closes the
socket and than wants to establish the SAME connection again ( due to
firewall reasons it has to be the SAME IP AND PORT).
Whatever I do, after close and trying to listen again, binding on the
local IPPort gets me the "connection in use error".
I use shutdownboth, close I use lingeroption with false and 0, I tried
to calle GC after close, I even tried to call socket.Dispose via reflection.
I can see in debug window, that socket is closed and cleaned up is set
to true and the local and remote endpoint properties are NULL, BUT there
is aa local ippoint member still active.
So how the hell can I clean up that socket to reconnect ??
I tried the UseSameAdress option, i dont get the socket in use
exception, but than no event is fired when the client connects (begin
accept delegate not fired), so obviously the clients seem to connect to
the dead socket somehow.
Any help please !
Joe Robe
I browsed the news and a few seem to have this problem too, but no
solution !
I have a client server application where in case the connection gets bad
(crashes or whatever) client or server (who knows it first) closes the
socket and than wants to establish the SAME connection again ( due to
firewall reasons it has to be the SAME IP AND PORT).
Whatever I do, after close and trying to listen again, binding on the
local IPPort gets me the "connection in use error".
I use shutdownboth, close I use lingeroption with false and 0, I tried
to calle GC after close, I even tried to call socket.Dispose via reflection.
I can see in debug window, that socket is closed and cleaned up is set
to true and the local and remote endpoint properties are NULL, BUT there
is aa local ippoint member still active.
So how the hell can I clean up that socket to reconnect ??
I tried the UseSameAdress option, i dont get the socket in use
exception, but than no event is fired when the client connects (begin
accept delegate not fired), so obviously the clients seem to connect to
the dead socket somehow.
Any help please !
Joe Robe