TCP connections left in CLOSE_WAIT state after players disconnect from server

Bug #566915 reported by cAPTAIN^k
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Gang Garrison 2
Fix Released
Medium
MedO

Bug Description

TCP connections left in CLOSE_WAIT state after players disconnect from server

These simply accumulate indefinitely until the program is exited

Revision history for this message
cAPTAIN^k (k-old) wrote :
Revision history for this message
cAPTAIN^k (k-old) wrote :

I am running Windows 7 Professional 64bit

MedO (smaxein)
Changed in gg2:
status: New → Confirmed
importance: Undecided → High
importance: High → Medium
Revision history for this message
MedO (smaxein) wrote :

I wanted to tackle this bug right now, but for some reason I can't reproduce it anymore. Can you check again if it still happens for you?

Changed in gg2:
status: Confirmed → Incomplete
Revision history for this message
notagenericname (mlin4589) wrote :

It happens to me

Revision history for this message
notagenericname (mlin4589) wrote :

okay I found the issue

while disconnecting the player using Player_Leave it uses remove player to get rid of it

however all it does is remove it from the list, and destroy the object.

directly using closesocket into removePlayer script should do it (untested, going to try right now)

Revision history for this message
notagenericname (mlin4589) wrote :

replace the removePlayer script with this
{
    closesocket(argument0.socket) // this is all I added
    with(argument0) {
        instance_destroy();
    }

    ds_list_delete(global.players, ds_list_find_index(global.players, argument0));
}

Revision history for this message
notagenericname (mlin4589) wrote :

also game server begin step the script concerning joining players
        if(sockstatus == 2) {
            closesocket(client)//all I changed
            with(joiningPlayer) {
                instance_destroy();
            }

Revision history for this message
MedO (smaxein) wrote :

closesocket is already called within the Destroy event of the Player object, so the change in removePlayer should make no difference. However, the suggestion for serverBeginStep looks good for fixing the problem. Thanks for your effort.

Changed in gg2:
assignee: nobody → MedO (smaxein)
status: Incomplete → Triaged
Revision history for this message
MedO (smaxein) wrote :

Actually, the second suggestion isn't the cause of the bug either. If nibbleMessage returns 2 it already closed the socket. I'm diving in some more to see if I can find other suspect places.

Revision history for this message
MedO (smaxein) wrote :

I rewrote the server-side player joining code completely now because it was horrible. Please try the version at http://ganggarrison.com/GG2_newconnectcode.zip and check if the problem is fixed.

Changed in gg2:
status: Triaged → Fix Committed
MedO (smaxein)
Changed in gg2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.