Hi,
Ich habe mal ein DestktopStreamer gebaut. Bei mir und Kumpel liefs ehr moderat. Wie läufts bei euch ?
Server: bitte den @ipaddress macro anpassen !
Spoiler anzeigen
#include <ScreenCapture.au3>
$TcpLenth = 8192
FileDelete(@ScriptDir & "\Temp.jpg")
Global $IP = @IPAddress3
TCPStartup()
[/autoit] [autoit][/autoit] [autoit]$Socket = TCPListen($IP, 4412, 1)
[/autoit] [autoit][/autoit] [autoit]ConsoleWrite($IP & @CRLF)
Do
$Connection = TCPAccept($Socket)
Until $Connection <> -1
FileDelete(@ScriptDir & "\Temp.jpg")
_ScreenCapture_SetJPGQuality(50)
While 1
_ScreenCapture_Capture(@ScriptDir & "\Temp.jpg")
$File = FileOpen(@ScriptDir & "\Temp.jpg", 16)
TCPSend($Connection, "SF")
While 1
$Read = FileRead($File, $TcpLenth)
If @error Then
TCPSend($Connection, "EOF")
$Read = ""
FileClose($File)
FileDelete(@ScriptDir & "\Temp.jpg")
ExitLoop
EndIf
TCPSend($Connection, $Read)
If @error Then Exit
WEnd
WEnd
Client
Spoiler anzeigen
TCPStartup()
$TcpLenth = 8192
FileDelete(@ScriptDir & "\Screen.jpg")
$IP = InputBox("IP", "Bitte Server IP eingeben.")
$Connection = TCPConnect($IP, 4412)
If $Connection < 0 Then
MsgBox(16, "Error", "Konnte keine Verbindung herstellen!")
_Exit()
EndIf
Opt("GUIOnEventMode",1)
[/autoit] [autoit][/autoit] [autoit]$gui = GUICreate("", 1024, 768, 1, 1)
GUISetOnEvent(-3, "_Exit")
$Pic = GUICtrlCreatePic("", 1, 1, 1024, 768)
GUISetState(@SW_SHOW)
While 1
$Resv = TCPRecv($Connection, 2)
If @error Then
MsgBox(16, "Error", "Verbindung unterbrochen!")
_Exit()
EndIf
If $Resv = "SF" Then
$File = FileOpen(@ScriptDir & "\Screen.jpg", 1)
If $File = -1 Then Exit
While 1
$Resv = TCPRecv($Connection, $TcpLenth)
If @error Then
MsgBox(16, "Error", "Verbindung unterbrochen!")
_Exit()
EndIf
If $Resv = "EOF" Then
$Resv = ""
FileClose($File)
GUICtrlSetImage($Pic, @ScriptDir & "\Screen.jpg")
FileDelete(@ScriptDir & "\Screen.jpg")
ExitLoop
EndIf
FileWrite($File, $Resv)
WEnd
EndIf
WEnd
Func _Exit()
TCPShutdown()
Exit
EndFunc ;==>_Exit