I am trying to get a package in PHP, but it looks like socket_recv to lose a few bytes.
I know that the package was sent normally:
0:13:58.951742 IP 192.168.0.101.1458 > 192.168.0.107.8000: Flags [P.], seq 1:7, ack 1, win 64240, length 6 0x0000: 4500 002e 631d 4000 8006 158c c0a8 0065 E...c.@........e 0x0010: c0a8 006b 05b2 1f40 6557 d628 4e87 cadd ...k...@eW. (N... 0x0020: 5018 faf0 e808 0000 0068 6f6c 6100 P........hola.
and the data has the following meanings: 0000 0068 6f6c 6100
but whit:
socket_recv($socket, $buffer, 100, 0); echo bin2hex($buffer); echo unpack("H*", $buffer);
im getting both echoes: 00686f6c6100
it means:
sended: 0000 0068 6f6c 6100 receive: 00 68 6f6c 6100
what am I doing wrong?
thanks.
edit: I found a problem. Was on the code. thanks!
source share