In Development - Internet Connectivity [Test Demo]

So, me and a friend from work have been working on a script that will let you use internet on your games. He just sent me an update and it can now perform simple get and post http requests. This should be enough for simple features on offline games, but we still have to work a lot on it to enable the creation of more complex games.

The following is an encrypted demo of the script working:

http://hudell.com/downloads/connectiontest.exe

The demo is quite simple:

There are three NPCs on the center of the screen. If you talk to them, their position will change. 

Then there's another NPC with two options: "Upload their position" and "Download their position".

If you hit the "Upload their position" option, the game will send their position to my webserver, replacing the information currently there.

If you hit the "Download their position" option, the game will check the position that is saved on my webserver and change the NPCs accordingly.

You can test it by opening multiple instances of the game on the same computer, or opening it on two different computers. Both should work.

I don't know what will happen if a lot of people use it at the same time, so let me know if you get any kind of error.
fyi...

Code:
    DOMAIN = 'hudell.com'    TIMEOUT = 100
fyi...

    DOMAIN = 'hudell.com'    TIMEOUT = 100
Not a problem. 95% of people won't be able to use it even if they get that far.
7 minutes though, Kinda puts it in perspective how quick people can get into the default encrypted systems. D:

I feel bad, I've seen yours... Would you like to see mine? ^_^

Also, I'm VERY curious as to whats going on in you dll, cause quite frankly, its not required ~ not from my experiences.
I feel bad, I've seen yours... Would you like to see mine? ^_^
I'd love to, if you don't mind.

Though the script you saw was made in less than 20 minutes. All the important stuff is inside the dll. And I'm not allowed to talk about what happens in there (even I don't know much, as I made only the ruby part of it) 
Yea, I can tell most of its hidden away 😛

Out of curiosity, have you benchmarked any :GET or 😛OST requests?
I haven't.

How did you benchmark yours? I can make the same test with mine to compare.

I didn't even try to make two simultaneous requests yet.
Benchmark.ips do |x| x.report('fast') { HTTP::fastest_get } x.report('norm') { HTTP::normal_get } x.compare! endWhen I was closing my session after each get the time is significantly slower. :/
Created a new connection, made the request and waited for the response from my webserver:

Spoiler
One_call.png

The same request with curl:

Spoiler
One_call_curl.png
Same request to your server file. ( HTTP::full_get("www.hudell.com","/jogo/getposition.php") )

user system total realjogo 0.016000 0.000000 0.016000 ( 0.494029)What benchmarking tool did you use?  Not seen that kinda output before.  I used Benchmark.bm for the test shown above. 🙂
Benchmark v1.1 by Solistra, the first one I found on google

Edit: Can you do the same request with curl? It will probably give a different time too, because of your location.
Interesting. I've not used that tool before, have to check it out 🙂

And yea, I will do some more tests tomorrow. Its nearly 4am here and I can feel my eyelids closing ^_^

Also - did you change the database locations of your files ? I seem to be getting some error and the test demo you loaded doesnt seem to be saving my locations either.

Edit:

Just used that SES benchmark script to perform a get request to my server and this is the result.

---- BENCHMARK ----------------------------------------------------------------http: Process: 0.000000 Real: 0.17101 seconds------------------------------------------------------------------------------- TOTAL: 0.000000 (0.17101 seconds)Random question:

What happens when you perform a large number of iterations? Lets say, 100, or 1000 ?
Maybe my server was offline at that time. It's working now.

Since I wait for the response before doing a new request, calling it a hundred times will only multiply the time by 100.
Perhaps, as you state, its working now 🙂

Who is your server provider? (feel free to not tell 😛 )  I know your not excessively transmitting data, but requests seem to be a little slower to your server than my own, and I'm doing quite a fair amount within my php file. (transmitting alot more than 3 characters) 🙂

---- BENCHMARK ----------------------------------------------------------------your server :: get_position.php : Process: 0.000000 Real: 2.268129 secondsmy server :: get top ten highscores for ping .php file : Process: 0.016000 Real: 1.580091 seconds------------------------------------------------------------------------------- TOTAL: 0.016000 (3.84822 seconds)^ these tests where of ten iterations. So in theory, ten full requests to each server. 🙂
The server provider is dreamhost.

And it's even slower to me (you're probably closer to it than me).
If you haven't rented a dedicated server, a lot of the speed depends on how many virtual servers the provider hosted on a single real PC and what specs that PC has. It might simply be that dreamhost has several other (bigger) websites on the same unit as they would all share the same connection (reducing its max) and processing power.
If you haven't rented a dedicated server, a lot of the speed depends on how many virtual servers the provider hosted on a single real PC and what specs that PC has. It might simply be that dreamhost has several other (bigger) websites on the same unit as they would all share the same connection (reducing its max) and processing power.
Yes, I alone have over 50 websites on that same server and there's probably many other users.
Does the script support persistent connections?

Since I wait for the response before doing a new request, calling it a hundred times will only multiply the time by 100.
Using multiple threads to handle requests and responses would probably be something cool to have, but then having to piece it together would probably be kind of annoying. TCP already does it for you but I think that's for each request I think (so you still have to figure out how to get the order correct on your end)
Does the script support persistent connections?
I'm still fixing some issues, but yes.
Using multiple threads to handle requests and responses would probably be something cool to have, but then having to piece it together would probably be kind of annoying. TCP already does it for you but I think that's for each request I think (so you still have to figure out how to get the order correct on your end)
That is working already. All I need is to instantiate a new object for each thread.And each instance can have up to 64 simultaneous different requests.

Benchmarks:

Code:
---- BENCHMARK ----------------------------------------------------------------New connection with one request (waiting):  Process: 0.203000  Real:    0.55607 seconds-------------------------------------------------------------------------------                                              TOTAL: 0.203000 (0.55607 seconds)---- BENCHMARK ----------------------------------------------------------------New connection with 10 requests (waiting):  Process: 1.297000  Real:    3.601138 seconds-------------------------------------------------------------------------------                                             TOTAL: 1.297000 (3.601138 seconds)---- BENCHMARK ----------------------------------------------------------------10 connections with 10 requests (waiting):  Process: 2.610000  Real:    7.087292 seconds-------------------------------------------------------------------------------                                             TOTAL: 2.610000 (7.087292 seconds)---- BENCHMARK ----------------------------------------------------------------10 connections with 10 requests (not waiting):  Process: 0.015000  Real:    0.018001 seconds-------------------------------------------------------------------------------                                             TOTAL: 0.015000 (0.018001 seconds)---- BENCHMARK ----------------------------------------------------------------New connection with 100 requests (waiting):  Process: 16.328000  Real:    36.268713 seconds-------------------------------------------------------------------------------                                           TOTAL: 16.328000 (36.268713 seconds) 

Original thread: https://forums.rpgmakerweb.com/threads/in-development-internet-connectivity-test-demo.36251/