Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / DarkNet - Short freeze on connection to server

Author
Message
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 15th Sep 2013 00:37 Edited at: 15th Sep 2013 01:00
Hey everybody,

I have created a menu, where users can add servers to a list. When hitting refresh, connection is made to each server on the list (one at the time) and certain data, like latency is received... at least I'm in the process of writing that, but I've ran in a snag.

Darknet has a short freeze on connecting with a server, until accepted or rejected. Now this is no problem when connecting to the actual server, but to update a whole list, would give major freezage!

Any ideas on why it freezes like that and how I could fix it?

Edit
I've read something about a 'game tracking' server, where servers and clients share the data I need through a webserver...

I have full web-hosting with a lot of everything but have no experience with databases and such. FTP would be too easy, right?

Any ideas?

Thanks!

Regards Sph!nx
www.mental-image.net
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 15th Sep 2013 01:16
Aren't there some non-blocking commands you could use like (pseudo-code)



"Why do programmers get Halloween and Christmas mixed up?"
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 15th Sep 2013 01:57 Edited at: 15th Sep 2013 01:58
I don't really know what you mean.

In my main loop, all functions are separate. Everything is controlled by separate functions (sync function, menu controls, etc.) but when the function for client connection is called, the program simply freezes until the result is in (either connected or not) and then the program will run fine again.

Regards Sph!nx
www.mental-image.net
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 15th Sep 2013 03:21 Edited at: 15th Sep 2013 14:44
Yes.

Use mn Poll Connect() to query the connection establishment without pausing the application.



Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 15th Sep 2013 12:19
Quote: "I don't really know what you mean."

What Chris said


"Why do programmers get Halloween and Christmas mixed up?"
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 15th Sep 2013 15:48 Edited at: 15th Sep 2013 15:49
Thanks a lot guys!

I basically had to put 'block until connected' to 0 in the 'mn connect' command and then move the detection of the status to a looping function, like Chris provided, instead of single execute, like I had before.

Thanks again, you saved me!

Regards Sph!nx
www.mental-image.net
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 15th Sep 2013 17:07
OOps! I forgot to mention that block parameter

Login to post a reply

Server time is: 2026-07-07 11:21:33
Your offset time is: 2026-07-07 11:21:33