Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ problem when disconnecting

problem when disconnecting

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Yetro   (40 posts)  Bio
Date Tue 11 Jun 2002 03:57 AM (UTC)
Message
I was using win xp.. and smaug work fine.. especially when a player do a quit, he got disconnected.
Now i am on a win me... and when a player does a quit, he doesnt got disconnected (Zmud,Gmud).
The last message from that player is:
numbers... XXXX has quit (room XXXXXXX)

I think.. that i have look something related.. but not remember where..

greeting
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 11 Jun 2002 05:14 AM (UTC)
Message
Could be a problem with the TCP/IP implementation on ME. We've been over this ground before, try searching the forum.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Toy   (206 posts)  Bio
Date Reply #2 on Tue 11 Jun 2002 03:50 PM (UTC)
Message
I too have a problem with disconnecting. I run windows 98, and as usual, the connection would disconnect with the original source code. I've modified my code alot since I started working with it, and I've read through the forums about things like the TCP/IP. I've done everything I could find in the forums to fix the problem, but nothing has worked yet. Is it possible I have modified the part of the code with disconnects players, and if so, where can I find that portion of the code?
-Alexander

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Nexela   USA  (14 posts)  Bio
Date Reply #3 on Fri 31 Jan 2003 05:47 AM (UTC)

Amended on Fri 31 Jan 2003 05:50 AM (UTC) by Nexela

Message
I am having the same problem on a Win 98se Machine

smaug 14a cygwin src modified

Telnet, Zmud (all versions) after the disconnect message it just hangs there and I have to manually disconnect from the client which at times can be irritating when Im doing alot of testing :P anyone care to explain how the disconnecting works or maybe even has a fix for it? shutting down and rebooting the mud disconnect like normal though? am I not closing something fully? am I full of questions? no need to answer that! I cant figure it out for the life of me. and I didnt have the problem with the original source.

wait! wait! I didnt want to format!
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #4 on Fri 31 Jan 2003 01:19 PM (UTC)
Message
Easiest way to track this down is get an unaltered copy of the do_quit function and compare it line by line to the version you are running on your muds. Somewhere in there should be the source of why players that quit arent extracted properly.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #5 on Fri 31 Jan 2003 10:37 PM (UTC)

Amended on Fri 31 Jan 2003 10:39 PM (UTC) by Nick Gammon

Message
The fact that it works on XP and not ME suggests it is an operating system problem and not a SMAUG bug.

The important thing about closing a socket (TCP/IP connection) is that the close is not instantaneous. The end doing the close (in this case the server, in response to the QUIT command) sends a TCP packet with the FIN (finish) bit set. The client has to acknowledge that packet and reply with its own packet with the FIN bit set. The server then needs to acknowledge that the client has closed.

If one of those steps does not work properly then the server could think that the client has not yet closed its connection and keep the connection "alive" while it waits for it to close completely.

It wouldn't surprise me a great deal to find some versions of Windows not handling closing of sockets correctly.

I notice this code in the server, you could try implementing it by taking out the #if and #endif lines ...


#if defined(SO_DONTLINGER) && !defined(SYSV)
    {
        struct  linger  ld;

        ld.l_onoff  = 1;
        ld.l_linger = 1000;

        if ( setsockopt( fd, SOL_SOCKET, SO_DONTLINGER,
                        (void *) &ld, sizeof(ld) ) < 0 )
        {
            perror( "Init_socket: SO_DONTLINGER" );
            closesocket( fd );
            exit( 1 );
        }       
    }
#endif



However, that didn't compile for me. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nexela   USA  (14 posts)  Bio
Date Reply #6 on Sat 01 Feb 2003 03:33 AM (UTC)
Message
It compiled for me when I took those lines out however it didnt correct the problem :P

Time for me to break out my shovel and dig deeper

wait! wait! I didnt want to format!
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #7 on Sat 01 Feb 2003 05:14 AM (UTC)
Message
I just meant the two lines starting with #, not the lot.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nexela   USA  (14 posts)  Bio
Date Reply #8 on Sun 02 Feb 2003 03:30 AM (UTC)
Message
Those were the only lines I took out :P

maybe if I Define So_dontlinger? just have to remember Im still fairly new to coding so how would that be done

wait! wait! I didnt want to format!
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


26,983 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.