Alexxander Posted February 4, 2014 Share Posted February 4, 2014 (edited) Hello every one i'm new to TCP i am willing to learn networking with Autoit and making multi client servers i found this awesome topic '?do=embed' frameborder='0' data-embedContent>> by mr.bogQ but i found it too hard for me even a after i read his description multiple times so i decided to learn be trying i'm willing to make a simple local online availability checker where i am the server and other local PCs are the clients when i open the server script i see all the online PC in my networks after struggling alone for 3 hours with TCP commands trying to make my script i made this server #include <GUIConstantsEx.au3> TCPStartup() $socket = TCPListen("192.168.1.111", 90) GUICreate("new", -1, -1) GUISetState() $list = GUICtrlCreateList("", -1,-1,-1,-1) While 1 $accept = TCPAccept($socket) $recive = TCPRecv($accept, 1000000) $recivename = StringSplit($recive, ":") If $recivename[1] = "mynameis" Then GUICtrlSetData($list, $recivename[2]) If $recivename[1] <> "mynameis" Then GUICtrlSetData($list, "") Sleep(1000) WEnd Func ext() Exit EndFunc client TCPStartup() While 1 $socket = TCPConnect("192.168.1.111", 90) TCPSend($socket, "mynameis:" & @ComputerName) Sleep(1000) WEnd Func ext() Exit EndFunc i know my code is very basic but for now i'm so proud to what i had achieved my script is working for 1 client it cant deal with multiple clients at same time i cant understand how to mix GUI with TCP when dealing with multiple clients maybe if someone her can help me make my script a multiple clients supported please stay away from arrays i hate them please try to edit or direct me to edit my code i don't want examples from the internet this script is completely written by me thanks in advanced Edited February 4, 2014 by Alexxander Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 4, 2014 Moderators Share Posted February 4, 2014 please stay away from arrays i hate them Then programming is not the field for you... Alexxander 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Alexxander Posted February 4, 2014 Author Share Posted February 4, 2014 Then programming is not the field for you... yes i agree arrays is primary in programming but i believe that we can avoid arrays for a simple script like this right ? Link to comment Share on other sites More sharing options...
bogQ Posted February 5, 2014 Share Posted February 5, 2014 (edited) quick explanation of array is:excel sheet where for 1d arrayes (array[nRow]) you have one column with n rows, every cell holds some dataorexcel sheet where for 2d arrayes (array[n][n]) you have n column with n rows, every cell holds some datawell you can try to avoid them, you do have Assing and Eval so try with thembut dont expect alot of help, for someone to understand what is worng with some code will need to understand your code, avoiding array is a big problem on complex things.similar code with gui and arrayand picture for it Edited February 5, 2014 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
FireFox Posted February 5, 2014 Share Posted February 5, 2014 http://www.autoitscript.com/wiki/Arrays Link to comment Share on other sites More sharing options...
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