Code Monkey home page Code Monkey logo

Comments (14)

sergejusb avatar sergejusb commented on May 24, 2024

I'd second this issue. It's possible to crash server from the client side and have aforementioned exception (sorry, no repro).

from fleck.

rpgmaker avatar rpgmaker commented on May 24, 2024

I second this issue also

from fleck.

BenjaminLoesch avatar BenjaminLoesch commented on May 24, 2024

I second this issue too.

from fleck.

ernstnaezer avatar ernstnaezer commented on May 24, 2024

Please give this a try to check whether the issue has been resolved or not:
#27

from fleck.

BenjaminLoesch avatar BenjaminLoesch commented on May 24, 2024

Hi

I observe still the same problem also with your implementation.
Connection establishment and message passing works fine.
As soon I close Firefox I get an exception, see screenshot.
I use Windows 7, and Firefox 8.0.1.

Beni

-----Ursprüngliche Nachricht-----
Von: Ernst Naezer [mailto:[email protected]]
Gesendet: Mittwoch, 23. November 2011 12:15
An: Loesch Benjamin
Betreff: Re: [Fleck] Error when closing the socket on the client (#18)

Please give this a try to check if the issue has been resolved:
#27


Reply to this email directly or view it on GitHub:
#18 (comment)

from fleck.

rpgmaker avatar rpgmaker commented on May 24, 2024

That did not fix the issue for me
On Nov 23, 2011 6:14 AM, "Ernst Naezer" <
[email protected]>
wrote:

Please give this a try to check if the issue has been resolved:
#27


Reply to this email directly or view it on GitHub:
#18 (comment)

from fleck.

ernstnaezer avatar ernstnaezer commented on May 24, 2024

I've added a second layer of checks and removed the duplicate OnFaulted callback. Firefox now seems play nice but I'm not sure what the second Fault handler on the task object is doing differently then first one. Perhaps Statianzo can elaborate a bit on that?

from fleck.

statianzo avatar statianzo commented on May 24, 2024

The two OnFaulted handlers are for different purposes.

var task = Task.Factory.FromAsync<int>(begin, _stream.EndRead, null);
task.ContinueWith(t => callback(t.Result), TaskContinuationOptions.NotOnFaulted)
    .ContinueWith(t => error(t.Exception), TaskContinuationOptions.OnlyOnFaulted);
task.ContinueWith(t => error(t.Exception), TaskContinuationOptions.OnlyOnFaulted);

The chained ContinueWith handles exceptions thrown in callback. The second handles exceptions thrown from _stream.EndRead.

Not having the second ContinueWith will cause EndRead exceptions to get swallowed.

from fleck.

ernstnaezer avatar ernstnaezer commented on May 24, 2024

right,. that makes a lot of sense!

On Wed, Nov 23, 2011 at 22:30, Jason Staten
[email protected]
wrote:

The two OnFaulted handlers are for different purposes.

   var task = Task.Factory.FromAsync(begin, _stream.EndRead, null);
   task.ContinueWith(t => callback(t.Result), TaskContinuationOptions.NotOnFaulted)
       .ContinueWith(t => error(t.Exception), TaskContinuationOptions.OnlyOnFaulted);
   task.ContinueWith(t => error(t.Exception), TaskContinuationOptions.OnlyOnFaulted);

The chained ContinueWith handles exceptions thrown in callback. The second handles exceptions thrown from _stream.EndRead.

Not having the second ContinueWith will cause EndRead exceptions to get swallowed.


Reply to this email directly or view it on GitHub:
#18 (comment)

from fleck.

statianzo avatar statianzo commented on May 24, 2024

I found that out the hard way when Fleck was silently failing.

What I might suggest looking into is handling AggregateException containing ObjectDisposedException in the error handlers of Send/Receive. No matter how many IsConnected style checks are put in before the Read/Write calls, there's still the possibility of of an ObjectDisposed due to the asynchronous operation of Fleck.

The other possibility is using CancellationTokens for the tasks. Not sure if that could prevent all ObjectDisposeds though.

I apologize for not getting to this. I've been swamped.

from fleck.

ernstnaezer avatar ernstnaezer commented on May 24, 2024

hi guys,

I've had some time to look into this issue again and I've added a separate function to run the async code that catches the disposed & IO exceptions. Please feel free to take a look at this commit and give it a try.

https://github.com/enix/Fleck/commit/32f0f72ac3d10862f0599f2c808727178c3b026a

from fleck.

statianzo avatar statianzo commented on May 24, 2024

Please test this fix out (for the ObjectDisposed, not IOException). The exceptions still get logged when verbosity is Debug, but the server shouldn't get taken down.

from fleck.

rpgmaker avatar rpgmaker commented on May 24, 2024

Works for me it seems
On Jan 2, 2012 6:52 PM, "Jason Staten" <
[email protected]>
wrote:

Please test this fix out (for the ObjectDisposed, not IOException). The
exceptions still get logged when verbosity is Debug, but the server
shouldn't get taken down.


Reply to this email directly or view it on GitHub:
#18 (comment)

from fleck.

statianzo avatar statianzo commented on May 24, 2024

I'm going to close this. The fix is included in 0.8.2, currently on Nuget.

from fleck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.