Re: Sending messages from php to C++ application via UDP socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18 May 2011 18:03, shiplu <shiplu.net@xxxxxxxxx> wrote:
> Try to think a string is an array of bytes.
> Parse that array of bytes at C++ end.
> There should host to network and network to host data conversion function.
> Use them.
>
> --
> Shiplu Mokadd.im
>

Just to confirm Sniplu's comment really.

For example (see http://unicode.org/faq/utf_bom.html#bom4)

$s_Utf8Bom = chr(0xEF) . chr(0xBB) . chr(0xBF);

This will build the UTF-8 Byte Order Mark.

You can use http://uk.php.net/manual/en/function.pack.php to build a
binary string comprised of different values based upon C types
(int/long, signed/unsigned, chars, hex strings, floats/doubles, nulls,
etc.)

In essence, if you have a C struct that represents the data you need
to send, then you should be able to compose a suitable string.

If you already have an app that can talk to the media player, then use
a tool like wireshark to monitor the communication. That, at least,
will give you real world example of the data you need to send.

Richard.






-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux