Jump to content
Sign in to follow this  

tcpsending strings

Recommended Posts


I have a client/server script and all works well connecting and such.

The problem lies i guess in autoit doing something i didn't expect.

I have a server with a list of connections. When a new connection comes, it sends the list to them. I want that client to be able to utilize that list that i was sent.

Now I thought that if I did a tcpsend($data), autoit would receive JUST that data on the next tcprecv call. But instead im getting results where if Im sending string values, if I do say 10 tcpsends of various ips, the 1 tcprecv function may contain a string of up to all those ips.

I guess what im saying is, do I have to have support to parse strings because tcpsend just mushes it together when its strings? Or is there something im not getting here?

eg. The server does 10 tcpsend commands with each one containing a ip.

The client attempts to tcprecv 10 times but only 1 is needed as it retreives all the ips at once.

Do I need to setup a method to split the strings for handling or is there a way to send data, wait for it to be received, then send again so that each set of data isn't combined with another set?

Share this post

Link to post
Share on other sites

Of course you can set up another tcp connection and let the client confirm that the data has been recieved, but I think that it would be easier if you just combine your strings with a special character (like %) and then just StringSplit($incomingstring,"%")

Hope it helps

Broken link? PM me and I'll send you the file!

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