Re: [PHP] binary data over UDP with PHP?

2004-07-08 Thread Aidan Lister
If you're receiving binary data back, this function may interest you: http://aidan.dotgeek.org/lib/?file=function.hexdump.php Also, why are you messing with chr etc? $string = "\x00\x01\xFF"; etc. "Coder_1024" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thanks for the feedback

Re: [PHP] binary data over UDP with PHP?

2004-07-07 Thread coder_1024
Thanks for the feedback. As it turns out, the reason I was getting zero data bytes in my UDP packet was that I had declared the packet variable outside the function in which I was using it. $packet = chr(0x01).chr(0x1d) etc function doSomething($x) { // using $packet in here gives you an

Re: [PHP] binary data over UDP with PHP?

2004-07-07 Thread Keith Greene
I use the following without problem: $fp = fsockopen("udp://www.server.com", 24250, &$errno, &$errstr, .2); if (!$fp) { $status = "Server not available"; } else { $trigger = chr(hexdec('FF')).chr(hexdec('FF')).chr(hexdec('01')).chr(hexdec('00')); fwrite($fp,$tr

[PHP] binary data over UDP with PHP?

2004-07-07 Thread coder_1024
I'm trying to send some binary data to a UDP server using PHP. The examples I've been able to find show sending binary data over TCP, or they show sending text over UDP. I'm constructing the messages using the below: $text_msg = "Hello, World\r\n"; $binary_msg = chr(0x01).chr(0x02).chr(0x00)