felixli93 Posted May 8, 2009 Posted May 8, 2009 hi,i want to make kinda instantmessenger between two computers (my friend's and mine)what do I have to do?So this works just fine:Receiving:UDPStartup() $ip = @IPAddress1 $socket = UDPBind($ip, 80) While 1 $data = UDPRecv($socket, 50) If $data <> "" Then TrayTip("Incoming Data", "Incoming Data: ''"&$data&"''", 5) EndIf sleep(100) WEnd Func OnAutoItExit() UDPCloseSocket($socket) UDPShutdown() EndFuncSending:Opt ("OnExitFunc","_CloseService") UDPStartup() $IP = @IPAddress1 $socket = UDPOpen($IP, 80) $data = InputBox ("What to send?","What do you want to send?","this is a test") $success = UDPSend($socket, $data) If Not $success Then MsgBox(16, "ERROR", "Error while sending UDP message: " & @error) UDPCloseSocket($socket) UDPShutdown() Exit Else MsgBox (64,"Success","Data sent!") EndIf Exit Func _CloseService () UDPCloseSocket ($socket) UDPShutdown () EndFuncthis works just fine,now I want to send data between 2 different computershow do I do that?tried to just change $ip to the IP given by WhatIsMyIp.combut this doesn't work; the @error then returns an error code given by the WINApi, and the array socket doesn't return anything but -1 in subscript [0]Pls help me!
computergroove Posted May 8, 2009 Posted May 8, 2009 (edited) You are probably getting blocked by a firewall either at the sending, receiving or isp. Edited May 8, 2009 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html
ChrisL Posted May 8, 2009 Posted May 8, 2009 If the PCs are sat behind a router then you will need to setup port forwarding on the router. Forwarding the port 80 on to the local IP address [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
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