This project has moved. For the latest updates, please go here.

Crash on Disconnect

Jul 8, 2010 at 5:31 PM


I am using this library on a client/server application.

My problem is, when the client disconnects, server crashes.  And the server disconnects, client crashes.

Message error is:

System.Net.Sockets.SocketException was unhandled
  Message="An existing connection was forcibly closed by the remote host"
       at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
       at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
       at System.Windows.Forms.WindowsFormsSynchronizationContext.Send(SendOrPostCallback d, Object state)
       at Nito.Async.CallbackContext.<>c__DisplayClass18.<AsyncBind>b__16() in C:\Users\dndiaye.dhi\Documents\_DHI\DEV\DHI\TELE DIFFUSION\VIDEO_CLIENT_SERVEUR\Nito.Async\CallbackContext.cs:line 344
       at Nito.Async.Timer.<>c__DisplayClass1.<set_Enabled>b__0(Object state) in c:\users\dndiaye.dhi\documents\_dhi\dev\dhi\tele diffusion\video_client_serveur\nito.async\timer.cs:line 161
       at System.Threading._TimerCallback.TimerCallback_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading._TimerCallback.PerformTimerCallback(Object state)

Could you help with this please?



Jul 8, 2010 at 7:25 PM

First, ensure that you are using version 1.4.

Also ensure that all sockets are given a WriteCompleted event handler that will close the socket if an error occurs.

If both of these appear correct, go ahead and post the code.