En el lado cliente:
Código: Seleccionar todo
TCPStartup()
$socket = -1
$ip = TCPNameToIP (hostname.dyndns.org")
$socket = TCPConnect ($ip, 65432)
if $socket = -1 then
Exit 0
EndIf
While 1
TCPSend($socket, "alarma")
if @error then ExitLoop
HotKeySet("{ESC}", "_Exit")
Wend
Func _Exit()
Exit 0
EndFunc
Código: Seleccionar todo
TCPStartup()
$socket = TCPListen ("192.168.1.X", 65432, 5000)
if $socket = -1 then
Exit
EndIf
Do
$socketconect = TCPAccept($socket)
Until $socketconect <> -1
While 1
$recv = TCPRecv($socketconect, 100)
If $recv = "alarma" Then
for $i = 0 To 10
Beep (500 * $i, 5000)
HotKeySet("{ESC}", "_Exit")
next
EndIf
HotKeySet("{ESC}", "_Exit")
Wend
Func _Exit()
Exit
EndFunc
Saludos