SuFu hab ich auch schon benutzt. Ich schau mal, ob ich den code von dem TCP Tutorial noch n wenig abändern kann, dass des Dateien sendet. Mein code überträgt mir immer alles bis ca auf 50 kb
Mein Code (nich grad der schönste und auf langsam übertragen eingestellt):
Empfänger:
Code:
TCPStartup()
$IP = InputBox("IP", "Bitte Server IP eingeben.", "127.0.0.1")
$Connection = TCPConnect($IP, 4412)
If $Connection < 0 Then
MsgBox(16, "Error", "Konnte keine Verbindung herstellen!")
_Exit()
EndIf
While 1
$Resv = TCPRecv($Connection, 2)
If @error Then
MsgBox(16, "Error", "Verbindung unterbrochen!")
_Exit()
EndIf
If $Resv = "SF" Then
While 1
$Resv = TCPRecv($Connection, 2048, 1)
If @error Then
FileWrite("Datei.exe", $Resv)
MsgBox(16, "Error", "Verbindung unterbrochen!")
_Exit()
EndIf
FileWrite("Datei.exe", $Resv)
WEnd
EndIf
WEnd
Func _Exit()
TCPShutdown()
Exit
EndFunc ;==>_Exit
Sender:
Code:
Global $IP = "127.0.0.1"
TCPStartup()
$Socket = TCPListen($IP, 4412, 1)
Do
$Connection = TCPAccept($Socket)
Until $Connection <> -1
$File = FileOpen("bdcamsetup.exe", 16)
While 1
TCPSend($Connection, "SF")
While 1
$Read = FileRead($File, 2048)
If @error Then
FileClose($File)
Exit
EndIf
TCPSend($Connection, $Read)
If @error Then Exit
WEnd
WEnd