Author Topic: Qestion about Ptokax UDP-Debug messages  (Read 3814 times)

0 Members and 1 Guest are viewing this topic.

Offline Alexandros

  • Forum Ace
  • *****
  • Posts: 78
  • Karma: +1/-0
Qestion about Ptokax UDP-Debug messages
« 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

PtokaX forum

Qestion about Ptokax UDP-Debug messages
« on: 24 November, 2006, 03:14:29 »

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: Qestion about Ptokax UDP-Debug messages
« Reply #1 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).
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline Alexandros

  • Forum Ace
  • *****
  • Posts: 78
  • Karma: +1/-0
Re: Qestion about Ptokax UDP-Debug messages
« Reply #2 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.

Offline Alexandros

  • Forum Ace
  • *****
  • Posts: 78
  • Karma: +1/-0
Re: Qestion about Ptokax UDP-Debug messages
« Reply #3 on: 25 November, 2006, 16:44:06 »
Thanks Mutor

Offline Tw?sT?d-d?v

  • Lord
  • ***
  • Posts: 436
  • Karma: +79/-2
    • EURO-OP
Re: Qestion about Ptokax UDP-Debug messages
« Reply #4 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:


Code: [Select]
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;


Code: [Select]
do
{
  ret = recvfrom(...);
  if ( ret == SOCKET_ERROR )
    err = WSAGetLastError ( );
  else
    dispatch_data ();
}while ( ret != SOCKET_ERROR || ( ret == SOCKET_ERROR && err == WSAECONNRESET ) )

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: Qestion about Ptokax UDP-Debug messages
« Reply #5 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 ::)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline CrazyGuy

  • Viking
  • ****
  • Posts: 506
  • Karma: +83/-20
    • ?????=-_The NightHawk_-=?????
Re: Qestion about Ptokax UDP-Debug messages
« Reply #6 on: 11 January, 2007, 11:44:46 »
Quote
in 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.

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 ?

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
Re: Qestion about Ptokax UDP-Debug messages
« Reply #7 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); ...
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline Tw?sT?d-d?v

  • Lord
  • ***
  • Posts: 436
  • Karma: +79/-2
    • EURO-OP
Re: Qestion about Ptokax UDP-Debug messages
« Reply #8 on: 11 January, 2007, 18:22:14 »
Had a similair problem a few days ago. Resetting my modem solved that.


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

PtokaX forum

Re: Qestion about Ptokax UDP-Debug messages
« Reply #8 on: 11 January, 2007, 18:22:14 »