|
Posted by Henk on 06/07/05 17:38
Hello,
I'm working with the socket functions from php and connect to a socket
server, written in c++.
I can send (text) strings from php to the server, but I would like to know
how I can send a binary stream. I would like to send the string WITH the
terminating zero over the socket. I would like to do this because it's
possible on the receive side that I receive more than one message at once
(because it's a stream).
if (!socket_connect($sock, $address, $port))
{
}
else
{
socket_write($sock, $msg,$length);
}
so the $msg should be modified to a binary string so that the socket write
function includes the terminating zero. Or should I use other functions to
encode the data before sending it over the socket?
regards,
Henk
[Back to original message]
|