Actually, looking though how bad it is, don't bother looking. But for
reference, most of the code was "borrowed" from librtmp/rtmpdump
source code. I think rather than sticking to a notional spec, doing
whatever they do will probably work better.

On Fri, Aug 10, 2012 at 3:35 PM, Adam Malcontenti-Wilson
<[email protected]> wrote:
>
> Hi, I did a bit of work trying to get rtmp on node.js off and on over the 
> past couple of years, never really got too far either.
> That being said, it is at least recent enough to use the Buffer API rather 
> than binary strings.
> It's at https://github.com/adammw/node-rtmp but poorly written and not 
> maintained - your welcome to have a peek at it if it helps.
>
>
> On Fri, Aug 10, 2012 at 8:35 AM, Eric S <[email protected]> wrote:
>>
>>
>>
>> On Thursday, August 9, 2012 2:02:47 PM UTC-7, david rene comba lareu wrote:
>>>
>>>
>>>
>>> now, the linked library do all this, but get broken at the point of 
>>> checking the 4 zero's. it uses the Net module to create a server, and 
>>> listen on connection event. using the socket object provided by the event, 
>>> set the encoding to "binary" (this type of encoding doesn't exist as far i 
>>> see in the 
>>> documentationhttp://nodejs.org/api/stream.html#stream_stream_setencoding_encoding
>>>  ) and then try to check for the four zero's
>>
>>
>> I'm not an expert yet, but I may have been following Node development long 
>> enough to explain this.  As I understand it, "binary" encoding was how node 
>> handled binary data originally, but this was replaced by buffers at some 
>> point because it wasn't handling things in a smooth manner.  A buffer is 
>> basically an array of octets with no character fiddling (in order to 
>> transparently handle binary data).
>>
>> Now, the documentation you linked to states that if stream.setencoding() 
>> isn't called, then the data event emits a buffer, which I think is exactly 
>> what you want.  Assuming that you've got a buffer that just happens to start 
>> at the start of the packet (which may not be a safe assumption, just using 
>> that as an example), buffer[0] would be the version number, 
>> buffer[1]-buffer[4] would be the timestamp, and buffer[5]-buffer[8] would be 
>> your zeros.
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: 
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>
>
>
>
> --
> Adam Malcontenti-Wilson




--
Adam Malcontenti-Wilson

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to