Jump to content

Recommended Posts

Posted

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

Posted (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 by SoulA
Posted

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

cant 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.

Posted (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 by SoulA

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...