Jump to content

TCP related


DiskAI
 Share

Recommended Posts

Not quite sure what you mean -- it seems that different TCP sockets are only identified by some integer being returned by (for instance) a TCPConnect() call.

You could always use variables to differentiate between different connections (but I imagine I have the question wrong because you would already be doing this to an extent):

TCPStartup()

Local $WebSocket = TCPConnect(TCPNameToIP("www.autoitscript.com"), 80)
Local $FTPSocket = TCPConnect(TCPNameToIP("ftp.example.net"), 21)
Local $ServerSocket = TCPConnect("10.0.0.3", 1928)
Link to comment
Share on other sites

thanks for the reply

well ... my intention was to rename the incoming/connected socket to different name ie. the chat user name so other than $ConnectedSocket it would read as $ChatNickname

is there any way to dynamically create variables on the fly such as in (again quoting from mirc scripting) $("nickname") that would be handle the same as $nickname

larry's chat example seems to try to work around the problem by handling the "rogue" socket but i think it would be easier to rename the already connected socket to another name and keep the main socket open to listen for incoming tcp connection

your idea of pre assigning variables (a good one at that) only could cover a small scale connection

hope you would see what i would like to happen

i think

Link to comment
Share on other sites

Yes. Arrays are probably the best for this sort of thing but check out the Assign() function:

Assign("apple", "banana")
; $apple => 'banana'

There are also flags that can be added to the end of an Assign() to indicate the scope of newly-created variables and such.

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...