Jump to content

Client / Server script - speed optimization


Recommended Posts

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

Link to comment
Share on other sites

  • 1 year later...

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 ?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...