Jump to content

Tcp Problem


Recommended Posts

hello all i have a problem how to send from gui and receive to server the reverse work fine i mean sent from server and receive to gui please help .

 

 

Gui

 

#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 ("Autoit.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

 

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