Jump to content

TCPRecv problem Buffer issue.


 Share

Recommended Posts

hi,

I have a problem with TCPRecv.

it seems that it stop getting TCP data after a while with no good reason. I think it is because of how packets are being received and I need to talk to

someone that wrote it. I think it has problem with buffer issues on non-raw data, burst data that is.

this is my code: (don't try to run it!)

;CLIENT! Start Me after starting the SERVER!!!!!!!!!!!!!!!
; see TCPRecv example
#include <GUIConstants.au3>
#include <String.au3>
#include <Array.au3>
#include <String.au3>
#include <GUIConstants.au3>
Dim $L[5000]
; Start The TCP Services
;==============================================
TCPStartup()
$i = 1
; Set Some reusable info
;--------------------------
Dim $szServerPC = "9.148.218.20"
; Set $szIPADDRESS to wherever the SERVER is. We will change a PC name into an IP Address
Dim $szIPADDRESS = "9.148.218.20"
Dim $nPORT = 23

$i = 1
; Initialize a variable to represent a connection
;==============================================
Dim $ConnectedSocket = -1
Dim $GOOEY = GUICreate("Test: " & $szIPADDRESS & ")", 300, 200)
Dim $edit = GUICtrlCreateEdit("", 10, 10, 280, 180)
GUISetState()

;Attempt to connect to SERVER at its IP and PORT 33891
;=======================================================
$ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)


Sleep(600)
TCPSend($ConnectedSocket, Binary("0xfffb18fffb1f"))

TCPSend($ConnectedSocket, Binary("0xfffc20fffc23fffb27"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0xfffa1f00500019fff0"))
Sleep(100)

TCPSend($ConnectedSocket, Binary("0xfffa2700fff0"))
TCPSend($ConnectedSocket, Binary("0xfffa1800414e5349fff0"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0xfffd03"))
Sleep(10)
TCPSend($ConnectedSocket, Binary("0xfffb01fffe05fffc21"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0xfffc01"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0xfffd01"))

Sleep(1000)

TCPSend($ConnectedSocket, Binary("0x69"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0x62"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0x6d"))
Sleep(200)
TCPSend($ConnectedSocket, Binary("0x0d"))
Sleep(1000)
TCPSend($ConnectedSocket, Binary("0x69"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0x626d"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0x34"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0x69"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0x7372"))
Sleep(200)
TCPSend($ConnectedSocket, Binary("0x0d"))
Sleep(1000)
TCPSend($ConnectedSocket, Binary("0x77"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0x32"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0x6b74"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0x74"))
Sleep(200)
TCPSend($ConnectedSocket, Binary("0x0d"))
Sleep(1300)
$m=TCPRecv ($ConnectedSocket,2048,0)
TCPSend($ConnectedSocket, Binary("0x6c6973742062636d7320736b696c6c20313037"))
Sleep(100)
TCPSend($ConnectedSocket, Binary("0x0d"))
MsgBox (0,"this is $m",$m)
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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