Jump to content
Sign in to follow this  
nocker

Client / Server script - speed optimization

Recommended Posts

nocker

Using Kip's TCP UDF as a basis, I've made a client/server pair to run a dual-boxed machine using a hotbar like interface from the main machine.

I'd like the response time from when I click a hotbar button to when the client sends keystrokes to its instance of the game to be as fast as possible. It works ok, but it's a little slow for what I'm trying to do. I'm not sure where I'm bottle-necking though. I've commented out the gui on the client as it is unneeded.

Any input would be appreciated! Thanks!

Primary Box

-------------

server.au3

server.ini

tcp.au3

Secondary Box

-------------

client.au3

client.ini

tcp.au3

Not working? Things to try:

1) You need the latest version of autoit.

2) Server must be up and running before client, otherwise client will not connect.

3) Make sure you've edited the ip address in client.ini

Hints:

You can drag the server window by its right edge.

You can edit server.ini file to make it pop up where you want.

To close the server, use the tasktray icon.

In client.ini, it'll handle an unlimited # of inputs. So you can change the server depending on who you're using and not have to fiddle with the client.

"^" = ctrl

"!" = alt

clientserver.zip

Share this post


Link to post
Share on other sites
queensoft

I have tested your script, as well as original Kip's UDF with client/server examples.

I have changed IP in .INI file (server: 86.121.245.XX, client (FYI): 86.124.225.X) and tried several ports (88, 12345, 30213)

Started server, tooltip is 'creating server...'

Started client, after 10-20 seconds I get 'Could not connect to server'. I get error 10060 - googled it = Socket Error 10060 - Operation Timed Out

Firewall is off on both computers. Antivirus is Avira Free, has no firewall.

Client is Windows 7 x64 Ultimate, server is VMWare Windows XP SP3.

Both Windows'es have full Internet connection, all programs are accesing the Internet just fine. They have separate Internet connections.

I get same errors using you script and Kip's original.

Any ideas ?

Share this post


Link to post
Share on other sites
CodyBarrett

i do recommend Kip's udf for beginning uses, i personally wanted to know how networking protocols worked so i make my own scripts from scratch when i program.

i can't help you with kips udf, BUT i can guess the issue is with your servers router.

Share this post


Link to post
Share on other sites
queensoft

Both scripts use the same original Kip's UDF.

The server has no router.

Both machines have direct Internet connection.

Server is running inside VMWare, but I have used other client/server programs and they worked.

Right now I'm using TeamViewer and it's working just fine.

Share this post


Link to post
Share on other sites
CodyBarrett

port numbers the same? client directed at the servers ip? server running on the server ip?

Share this post


Link to post
Share on other sites
queensoft

Yup, already said that, same ports, client trying to connet to server IP....

Share this post


Link to post
Share on other sites
queensoft

Did another quick test, with RAdmin 3.4

Not working !!

It cannot connect, so I guess it's a VMWare problem.

Trying to find somebody with direct Internet connection, but all my friends have routers.

Share this post


Link to post
Share on other sites
CodyBarrett

i have a direct connection at my house. i only like dialup for that reason.

EDIT

as for the original question, "What can I do to make this faster?"

its normal for it to lagg in certain areas, TCP's signature handshake is designed to get a confirmation packet from both parties as an error checking system, it shouldn't be instantaneous, however, it shouldn't be extremely long

it should be on average TIME < 5second

Edited by CodyBarrett

Share this post


Link to post
Share on other sites
queensoft

Well, did another test, still not working.

This time they were two real machines.

If I run both server & client on same computer, it works.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.