2words4uready Posted August 7, 2008 Share Posted August 7, 2008 (edited) I've decided to jump into the Autoit world of TCP 1. What would be a good project to learn tcp? 2. Nothing too advanced. Edited August 8, 2008 by 2words4uready Link to comment Share on other sites More sharing options...
2words4uready Posted August 7, 2008 Author Share Posted August 7, 2008 Any Tcp tutorials would work as well. Link to comment Share on other sites More sharing options...
Glyph Posted August 7, 2008 Share Posted August 7, 2008 Maybe a remote command of some sort? send a tcp packet and have the other side reply with a message box? seems simple! tolle indicium Link to comment Share on other sites More sharing options...
SoulA Posted August 7, 2008 Share Posted August 7, 2008 (edited) I thought this code Here was very helpful. I just started TCP stuff myself a few days ago and this was a great start point. Doing a simple telnet like server. Edited August 7, 2008 by SoulA Link to comment Share on other sites More sharing options...
2words4uready Posted August 7, 2008 Author Share Posted August 7, 2008 Could some one post an example of a simple tcp script that sends a message box to another computer? I cant seem to figure the tcp out Link to comment Share on other sites More sharing options...
2words4uready Posted August 7, 2008 Author Share Posted August 7, 2008 Could some one post an example of a simple tcp script that sends a message box to another computer? I cant seem to figure the tcp outcant figure it out my code so far Server while 1 TCPStartup() $main = TCPListen(@ipaddress1, 1111) TCPAccept($main) If TCPRecv($main, 1000) = "{!}msg" Then MsgBox(0,"Test", "Message Sent") EndIf WEnd Client TCPStartup() $ip = "72.171.0.147" $msg = "{!}msg" $socket = TCPConnect($ip, 1111) TCPSend($socket, $msg) I'm assuming my code is way off. Any help would be appreciated. Link to comment Share on other sites More sharing options...
bf2forlife Posted August 7, 2008 Share Posted August 7, 2008 u should remove the tcpstartup from loop Link to comment Share on other sites More sharing options...
LarryDalooza Posted August 7, 2008 Share Posted August 7, 2008 Learn to send a TCP message that has a header describing the data. Interpret the header and act on the data. Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
2words4uready Posted August 7, 2008 Author Share Posted August 7, 2008 u should remove the tcpstartup from loopcode is still not working Link to comment Share on other sites More sharing options...
2words4uready Posted August 7, 2008 Author Share Posted August 7, 2008 Learn to send a TCP message that has a header describing the data. Interpret the header and act on the data.Lar.And how would i do this? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 7, 2008 Share Posted August 7, 2008 And how would i do this?See the examples in the helpfile or "Example Scripts" forum. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
SoulA Posted August 8, 2008 Share Posted August 8, 2008 (edited) Server $ip = @ipaddress1;or "0.0.0.0" for all interfaces $port = 1111 TCPStartup() $main = TCPListen($ip, $port) Do $socket = TCPAccept($main) Until $socket <> -1 Do $recv = TCPRecv($socket, 17520) Until $recv <> "" If $recv = "msgbox" Then MsgBox(0,"Test", "Message Sent") TCPCloseSocket($socket) TCPShutdown() Client $ip = "72.171.0.147" $port = 1111 $msg = "msgbox" TCPStartup() Do $socket = TCPConnect($ip, $port) Until $socket <> -1 sleep(50) TCPSend($socket, $msg) If @error Then MsgBox(0,"Error", "Message Failed To send") TCPShutdown() Basic Idea not tested Make sure if you test you have your firewall and what not set up to accept connections on whatever port you set for the server. Edited August 8, 2008 by SoulA 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