Thanks for response Will,
I found a sample class, that uses frameworks socket class and exports itself
with events and methods like WinSock.ocx in VB6. I looked up how the
disconnect event was raised:
The class uses async callbacks for reading the data, and when you call
EndReceive function on callback, the return value is BytesRead. If you get 0
bytes, the disconnect event is raised.
best re,
habix
"William Armstrong" <wi********@SPAMcrowsnest-design.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
If you have a pending read waiting on the Socket, it will fail with an
exception when the socket is closed. That should give you more timely
notification about the disconnection.
"HABJAN ®iga" <habix[AT]intelcom[DOT]si> wrote in message
news:bn********@enews3.newsguy.com... Is there a way to be notifyed (callback, event,...) when the connection
of socket was closed... The WinSock activex in vb6 had event
ondisconnect...
I get exception when i try to send some data, but i need disconnect info
sooner.
I have a solution with timer that checks the state of socket, but i
don't like to use timers...
best re,
habix