Forum C# How can be handled the server errors?

How can be handled the server errors?

Postby juvelez » October 5th, 2016, 5:31 pm

How can be handled the server errors?

In several cases like when a player closes an app with a client active connection or the network connection is suddenly lost, a server error is issued:

>Error: User disconnected ConnectionReset
EndRead failed. IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. client ip xxx.xxx.xxx.xxx

And in another cases IOErrors...

How can we handle this server errors properly?, that allows to broadcast to the others users what is happening.

Thanks in advance for any hrlp.
juvelez
 
Posts: 9
Joined: October 5th, 2012, 5:24 am

Re: How can be handled the server errors?

Postby Henrik » October 11th, 2016, 5:05 am

You should get a UserLeft event in your serverside code when this happens:

https://playerio.com/documentation/refe ... e#UserLeft
Henrik
.IO
 
Posts: 1822
Joined: January 4th, 2010, 1:53 pm

Re: How can be handled the server errors?

Postby juvelez » October 18th, 2016, 2:42 pm

But, there is a way to trap this kind of errors to avoid Server atop working?
juvelez
 
Posts: 9
Joined: October 5th, 2012, 5:24 am

Re: How can be handled the server errors?

Postby Henrik » October 18th, 2016, 6:40 pm

It doesn't stop working, it's just logging the disconnect so that you can see if you are getting an abnormal amount of them over time.
Henrik
.IO
 
Posts: 1822
Joined: January 4th, 2010, 1:53 pm

Re: How can be handled the server errors?

Postby juvelez » October 18th, 2016, 7:14 pm

Ok, thanks a lot for your answers...
juvelez
 
Posts: 9
Joined: October 5th, 2012, 5:24 am

Re: How can be handled the server errors?

Postby Emalton » November 25th, 2016, 8:30 pm

Is there a way to properly disconnect so that error message doesn't appear? Or do I just deal with it?
Emalton
 
Posts: 69
Joined: June 28th, 2013, 3:49 am

Re: How can be handled the server errors?

Postby Henrik » November 25th, 2016, 9:28 pm

Calling Disconnect from either clientside or serverside should not result in that error appearing. It's only supposed to log exceptional disconnections.
Henrik
.IO
 
Posts: 1822
Joined: January 4th, 2010, 1:53 pm

Re: How can be handled the server errors?

Postby Emalton » November 26th, 2016, 1:50 am

Oh, that makes sense... My bad!

Thanks again Henrik!

Image
Emalton
 
Posts: 69
Joined: June 28th, 2013, 3:49 am


Return to C#