DiskAI Posted October 12, 2005 Posted October 12, 2005 does autoit have function to rename the TCP socket connection. it would work like the one in mirc scripting where you could rename incoming connection to assign each socket differently i think
LxP Posted October 14, 2005 Posted October 14, 2005 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)
DiskAI Posted October 17, 2005 Author Posted October 17, 2005 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 $nicknamelarry'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 connectionyour idea of pre assigning variables (a good one at that) only could cover a small scale connectionhope you would see what i would like to happen i think
DiskAI Posted October 17, 2005 Author Posted October 17, 2005 salute to the master of autoit tcp how about creating variables on the fly ?? could it be done in autoit ?? i think
LxP Posted October 17, 2005 Posted October 17, 2005 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now