Code: Select all
STARTPACKET(pak,0x782,0x09);
SETBYTE( pak, 0x00, 0x23);
SETBYTE( pak, 0x01,0x00);
SETBYTE( pak, 0x03, 0x53);
SETWORD( pak, 0x04, 0x0200);Code: Select all
socket_write ( $sock, "test", strlen ( "test" ) );What I don't understand is how to handle packets that have been created using STARTPACKET in C++ with PHP's socket_read and socket_write functions. Socket_read() and socket_write() deal with a string. STARTPACKET is very complicated. I've been told that STARTPACKET uses some header to identify what packet it is. Is there a way to identify packets using headers in PHP? I've seen some functions such as pack and unpack that look useful, but I have NO idea how to use them to do this.
I just need to communicate with a program written in C++ using winsock with PHP.