PtokaX forum

PtokaX => Support => Topic started by: Alexandros on 24 November, 2006, 03:14:29

Title: Qestion about Ptokax UDP-Debug messages
Post by: Alexandros on 24 November, 2006, 03:14:29
hi, i want to know or where i can read about (or both) of this messages and what causes it.
i want to know if i have any problem on my server, i have less users than a month or two ago (like 100 less of 200)
recv() error WSAECONNRESET. User is being closed.
Login timeout 20 seconds for ******** - user disconnected.
thanks
Title: Re: Qestion about Ptokax UDP-Debug messages
Post by: PPK on 24 November, 2006, 07:19:19
WSAECONNRESET is conenction reset, it is socket error and here is no way to do anything against it. When windows want then they report this error on socket and connection is no more useable.
20 seconds is timeout of login, it is how long Ptokax waiting if user reply to $Lock. Most of this timeout is caused again by windows, because most of connections is from windows users and for unknown reason they sometimes get connected but don't reply to lock (it looks like it is not possible to send or receive anything on this connection).
Title: Re: Qestion about Ptokax UDP-Debug messages
Post by: Alexandros on 25 November, 2006, 05:29:53
Thanks PPK, now its worst :P i hate when i know what causes the problem but cant solve it.
Title: Re: Qestion about Ptokax UDP-Debug messages
Post by: Alexandros on 25 November, 2006, 16:44:06
Thanks Mutor
Title: Re: Qestion about Ptokax UDP-Debug messages
Post by: Tw?sT?d-d?v on 10 January, 2007, 20:26:32
in the last few days i noticed the same errors in PXUPDDEBUG (which didnt happen b4)   and after reading here i did some searching,
unsure if this would help in the error fixing ...

If you have a non-blocking recvfrom() loop like this to read from your socket, you are doing the wrong thing:



do
{
  ret = recvfrom(...);
  if ( ret != SOCKET_ERROR )
    dispatch_data ();
}while ( ret != SOCKET_ERROR )

Because WSAECONNRESET obviously causes a SOCKET_ERROR but actually there is no error and you should keep reading the socket when WSAECONNRESET occurs. So it should read something like this;



do
{
  ret = recvfrom(...);
  if ( ret == SOCKET_ERROR )
    err = WSAGetLastError ( );
  else
    dispatch_data ();
}while ( ret != SOCKET_ERROR || ( ret == SOCKET_ERROR && err == WSAECONNRESET ) )
Title: Re: Qestion about Ptokax UDP-Debug messages
Post by: PPK on 10 January, 2007, 21:16:47
I tryed to use sockets after they get WSAECONNRESET, but they continue in returning this error and is not possible to send or receive any data. And many this errors is returned because user disconnect ::)
Title: Re: Qestion about Ptokax UDP-Debug messages
Post by: CrazyGuy on 11 January, 2007, 11:44:46
Quotein the last few days i noticed the same errors in PXUPDDEBUG (which didnt happen b4)

Had a similair problem a few days ago. Resetting my modem solved that.

Quote from: PPK on 10 January, 2007, 21:16:47
I tryed to use sockets after they get WSAECONNRESET, but they continue in returning this error and is not possible to send or receive any data. And many this errors is returned because user disconnect ::)

Re-using sockets is also something that's troubling me when programming. I think it has to do with "disposed" sockets not being freed. Not quite sure how to work around that yet, but if I'm correct, Windows frees up used sockets on timer. There might however also be a function in the WSA to do this on command. Maybe interresting to look into ?
Title: Re: Qestion about Ptokax UDP-Debug messages
Post by: PPK on 11 January, 2007, 13:35:58
I don't have problem to reuse socket for another connection, when socket get error (except WSAEWOULDBLOCK, this one is normal for non-blocking sockets when is nothing to read) or otherside close connection then is socket closed by closesocket(socket); ...
Title: Re: Qestion about Ptokax UDP-Debug messages
Post by: Tw?sT?d-d?v on 11 January, 2007, 18:22:14
Quote from: CrazyGuy on 11 January, 2007, 11:44:46
Had a similair problem a few days ago. Resetting my modem solved that.


Never thought of that . done and all seems better   :)