I'm trying to listen to a certain connection and wait for a packet that contains "C8420000", is there a faster way I could do this? am I using StringInStr in a correct way? does adding a huge buffer size make room for the amount of bytes it can read per single read or does it make it slower? is opening one connection for receive and one for send a good idea or can I use the same socket for receiving and sending (I'll be sending a packet after doing some work on the received data so I need a send socket) any tips would be appreciated, thanks.
#include <Misc.au3>
TCPStartup()
$receive = TCPConnect("127.0.0.1", 16000)
$send = TCPConnect("127.0.0.1", 16000)
While 1
$data = TCPRecv($receive, 1000000, 1)
if StringInStr($data, "C8420000", 2) Then
;do stuff with $data
EndIf
WEnd