ludocus Posted July 7, 2008 Share Posted July 7, 2008 so what should I do now? replace: _TCP_Server_Create(88, @IPAddress1); A server. Tadaa! with: _TCP_Server_Create(88, '0.0.0.0'); A server. Tadaa! ?? or something you said with DynDNS (although I don't know what this is..) btw I have SpeedTouch 580 Link to comment Share on other sites More sharing options...
HCand Posted July 7, 2008 Share Posted July 7, 2008 i'd like to get past a little problem i have. Client: *Disconnects* Server: "huh?.. who did we just drop?" So far i can only think of dropping the ip in an array upon connection, and make it run through the _TCP_Server_ClientList() when anyone disconnects... or is there some other way i haven't discovered? Link to comment Share on other sites More sharing options...
Inververs Posted August 26, 2008 Share Posted August 26, 2008 (edited) nice! cool... but conflict with _ArrayDisplay().. #include "TCP.au3" #include <array.au3> Global $Test[2][2] _TCP_Server_Create(88, "192.168.0.20") _TCP_RegisterEvent($TCP_NEWCLIENT, "NewClient") ;or $TCP_DISCONNECT or $TCP_RECEIVE... While 1 Sleep(200) WEnd Func NewClient($hSocket, $iError) ; do something $Test[1][0]=$hSocket _ArrayDisplay($Test) ; // list liew not draw.. EndFunc ver au3 3.2.13.7 Will be good if you fix it.. thx! Edited August 26, 2008 by Odin Link to comment Share on other sites More sharing options...
toasterking Posted September 4, 2008 Share Posted September 4, 2008 Hey,Because people always ask how to create a TCP client/server, and then (if they get it) don't know how to make it multi client,I simplified it. It's event driven, so you don't have to manualy check everything.Just checked out your version 2 and I have to say that it's very impressive. It's much more efficient than what I've been doing, and I'm retooling all my TCP-aware scripts to take advantage of it.I did find a few design factors that can contribute to memory leaks, however. I have a script which has to frequently open and close one or more client connections, and every time _TCP_Client_Create is called, AutoIt allocates a little more RAM which it does not release when _TCP_Client_Stop is called. These seem to be causing the problems:- TCPStartup() is called everytime _TCP_Client_Create or _TCP_Server_Create runs. This allocates memory each time it is run which can only be released by calling TCPShutdown(). The AutoIt help file warns about this. I think it would be best to let the user call TCPStartup() themselves before calling any of your functions.- Likewise, you create a GUI window to receive messages each time _TCP_Client_Create or _TCP_Server_Create runs:CODELocal $hNotifyGUI = GUICreate("Kip's TCP UDF")_TCP_Client_Stop and _TCP_Server_Stop should run corresponding GuiDelete() commands to avoid memory leaks.- Many of Zatorg's functions (_ASock*) open a handle to a DLL that never gets closed:CODEIf $hWs2_32 = -1 Then $hWs2_32 = DllOpen( "Ws2_32.dll" )Then another handle is opened the next time one of the functions runs, which is also never closed. It makes more sense to me to just open one handle to the DLL and define it globally within the UDF:CODEGlobal $hWs2_32 = DllOpen( "Ws2_32.dll" )There may have been some specific functionality you intended by your design that I'm just overlooking. If so, please let me know! Overall everything looks fantastic and I'm just hoping to help you increase its efficiency. Thanks for reading! Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted September 5, 2008 Share Posted September 5, 2008 Very nice Kip. Although for me, (both client and server) stick around 85 % of CPU usage respectively. Hopefully there is a fix for this. Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
toasterking Posted October 7, 2008 Share Posted October 7, 2008 Very nice Kip.Although for me, (both client and server) stick around 85 % of CPU usage respectively. Hopefully there is a fix for this. Try adding a Sleep(100) inside the main loop in each script. Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted October 8, 2008 Share Posted October 8, 2008 Try adding a Sleep(100) inside the main loop in each script.Thanks for pointing that out.@Kip, you should really think about documenting your code. Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
Marlo Posted October 8, 2008 Share Posted October 8, 2008 This is awesome Was looking for somthing like this a while back. Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
jvanegmond Posted October 8, 2008 Share Posted October 8, 2008 I'm surprised to have just found this. An event-driven TCP UDF was just what was missing from AutoIt. Great idea, Kip. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Marlo Posted November 2, 2008 Share Posted November 2, 2008 Hi!!! just thought of an odd idea for your code This idea involves a CLIENT that will be on all the time and a server that will only be on somtimes. So what i need to do is use the client to keep trying to connect to the server (even when its offline) Now i cant actually think of a way to do this as theres no way to Poll to see if the server is online before attempting to connect. Any ideas? Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
Kip Posted November 2, 2008 Author Share Posted November 2, 2008 Are you trying to let us write code for you? MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Marlo Posted November 2, 2008 Share Posted November 2, 2008 no o_0 I just want to know how i would poll the server for a connection every so often. I have tried using the _TCP_Server_Create to poll on its own but the Socket is created even if no connection is made so its still returns a "connection" : / Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
TehWhale Posted November 3, 2008 Share Posted November 3, 2008 Yay! This is nice! So, if I wanted to use my external IP: which is 71.71.... how can I use this so people, anyone in the world can connect to my server on my computer? With @IPAddress1 is only allowed on my network. Link to comment Share on other sites More sharing options...
Kip Posted November 3, 2008 Author Share Posted November 3, 2008 if the server creates a socket on @IPAddress1, everybody in the world can acces it. Just make sure you have the right ports opened. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
jvanegmond Posted November 3, 2008 Share Posted November 3, 2008 if the server creates a socket on @IPAddress1, everybody in the world can acces it. Just make sure you have the right ports opened.Maybe where you are at but @IPAddress1 on my computer returns 192.168.0.100, and only people in my network can access it. I have to set up my router to port forwarding incoming connections from my WAN ip to my LAN ip. github.com/jvanegmond Link to comment Share on other sites More sharing options...
TehWhale Posted November 3, 2008 Share Posted November 3, 2008 Maybe where you are at but @IPAddress1 on my computer returns 192.168.0.100, and only people in my network can access it. I have to set up my router to port forwarding incoming connections from my WAN ip to my LAN ip.Yeah, from what I thought I thought you had to have your external IP I think, or internal the one that is not 192.168.1.101 (or whatever your last 3 digits are) So manadar, how can I forward those incoming connections? I know how to access my router, but what port do I forward. Link to comment Share on other sites More sharing options...
Kip Posted November 3, 2008 Author Share Posted November 3, 2008 Anyway, its not your ip you got from your ISP MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Marlo Posted November 3, 2008 Share Posted November 3, 2008 Any help with my problem? /beg Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
Kip Posted November 3, 2008 Author Share Posted November 3, 2008 (edited) Any help with my problem?Try it yourself, it isn't that hard to do. Edited November 3, 2008 by Kip MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Marlo Posted November 3, 2008 Share Posted November 3, 2008 Ahh figured it out at last lol...thanks for your help...(well kind of) Click here for the best AutoIt help possible.Currently Working on: Autoit RAT 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