- Joined
- Mar 15, 2006
- Messages
- 451
- Reaction score
- 285
There are several problems related with IO Completition Port. One of them is that Connect Server has a bug related with IOCP, another problem is that in win2k3 sp2 after some hours GS disconnects all users and noone can enter game, everyone stuck awaiting for Login Results and then get disconnected with error in gs related with response error.
Let's try to fix first problem related with CS.
Most of the people who used WebZen CS noticed that after a period of time it logs a error related with connection aborted by local system. Here it is: "The network connection was aborted by the local system", error 1236.
When this error occurres thread that receives this error just exits. I don't know how much threads CS starts for receiving and parsing data, probably 2*cpus(or cores). So for example if our CS has 2 working threads and if all of them have received this error CS stops parsing received data, because there no more working threads. So you can connect to CS, send data, but it will be in the deaf state.
But the point is that when using IOCP some of the errors must be ignored and 1236 is one of them, but in CS it's not ignored, that's why it dies.
take a look in CS code and GS code.
GS ignores this error. 0x4D4(1236)
CS:
GS:
So the solution is by adding a code that ignores this error.
1. jump to free space
2. check for errors, decide ignore or exit thread
haven't tested it, but it should help.
Let's talk about GS and win2k3 sp2, i had a possibility to learn why gs disconnects all users and then doesn't allow them to enter. I noticed that when this problem occured Worker Threads were suspended, so like with CS, GS becomes deaf. Then i found that threads exit with error 0x79(121) ERROR_SEM_TIMEOUT, tryed to google it but found nothing, so i decided to add code that ignores this error and continues execution. I had the possibility to test server only 24 hours and it worked without problems.
So win2k3 sp2 solution is by adding ignore error code 0x79(121) to CS(it also gave this error) and GS like we did for CS.
Let's try to fix first problem related with CS.
Most of the people who used WebZen CS noticed that after a period of time it logs a error related with connection aborted by local system. Here it is: "The network connection was aborted by the local system", error 1236.
When this error occurres thread that receives this error just exits. I don't know how much threads CS starts for receiving and parsing data, probably 2*cpus(or cores). So for example if our CS has 2 working threads and if all of them have received this error CS stops parsing received data, because there no more working threads. So you can connect to CS, send data, but it will be in the deaf state.
But the point is that when using IOCP some of the errors must be ignored and 1236 is one of them, but in CS it's not ignored, that's why it dies.
take a look in CS code and GS code.
GS ignores this error. 0x4D4(1236)
CS:
GS:
So the solution is by adding a code that ignores this error.
1. jump to free space
2. check for errors, decide ignore or exit thread
haven't tested it, but it should help.
Let's talk about GS and win2k3 sp2, i had a possibility to learn why gs disconnects all users and then doesn't allow them to enter. I noticed that when this problem occured Worker Threads were suspended, so like with CS, GS becomes deaf. Then i found that threads exit with error 0x79(121) ERROR_SEM_TIMEOUT, tryed to google it but found nothing, so i decided to add code that ignores this error and continues execution. I had the possibility to test server only 24 hours and it worked without problems.
So win2k3 sp2 solution is by adding ignore error code 0x79(121) to CS(it also gave this error) and GS like we did for CS.