Disconnect takeing 10 seconds


Here is some testcode: http://pastebin.com/nPwYj6wA
The Disconnect function takes exactly 10 seconds every time, in all functions i tried, i have like 5 functions connecting synchronous like that test code.
Is there something you can do or recommend?


Timiz0r wrote Dec 17, 2011 at 2:01 AM

I've noticed this too, and it's caused at SendRequest("quit"). Actually, while typing how I don't know the cause, I just found out why it's slow. Sending quit doesn't return a response packet, so the synchronous request has to time out.

What I'll do is remove that SendRequest, since it's not really necessary anyway. Also, to simplify the sample code I gave you, you don't really need the Disconnect() either. Disposing the RconClient (in the using) will automatically disconnect; I just threw it in there for the lulz.

Timiz0r wrote Dec 17, 2011 at 2:06 AM

And to be clear, I meant that the using statement automatically disposes, not that the RconClient should be disposed in the using statement.

RickardP wrote Dec 17, 2011 at 7:07 AM

has you removed the SendRequest("quit") in the "BF3Rcon.NET 12.0" or in alter code?

RickardP wrote Dec 17, 2011 at 7:17 AM

When i with version 12.0 release removing Disconnect function the application crashing after doing one of my rcon functions so something happening if i dont using Disconnect...

RickardP wrote Dec 17, 2011 at 7:26 AM

Latest code from dev looks like its works better...

RickardP wrote Dec 17, 2011 at 3:26 PM

After using latest code and remove the function call Disconnect i getting problems with the Visual Studio 2010 built in webserver, i gessing the socket threads not being closed right..

Timiz0r wrote Dec 17, 2011 at 6:53 PM

Well, first I took out the SendRequest("quit"), so disconnecting will be fast again.

Also, although I haven't had problems with disposing not working, I decided to put Disconnect in the Dispose method.

Timiz0r wrote Dec 17, 2011 at 6:55 PM

Also, if you still have problems when Disconnect isn't used, could you use WebMatrix for testing, wait for its webserver to crash, debug it with Visual Studio, and find out what's causing the problem, since I can't reproduce any problems with the sample code I gave you.

RickardP wrote Dec 17, 2011 at 7:32 PM

Thanks, testing..

Timiz0r wrote Jan 14, 2012 at 5:20 PM

The original bug has been fixed, so marking it as such.

wrote Feb 13, 2013 at 6:23 PM

wrote May 15, 2013 at 5:09 AM

wrote May 15, 2013 at 5:09 AM

wrote Jun 12, 2013 at 2:02 AM