Re: [nodejs] How to fill buffer till end?

2014-02-15 Thread Bodo Kaiser
So for those who are interested: I found out that the most easiest way is to emit remaining chunk at the end of the stream before doing `this.push(null)`. Then we only must create on the emitted chunk a new stream instance and write it onto it. Am 14.02.2014 um 22:22 schrieb i...@bodokaiser.io

Re: [nodejs] Can nodejs create a crypto key + certificate for me?

2013-08-31 Thread Bodo Kaiser
Hi Austin, I want to encrypt a json document and send it through insecure channels (e.g. unencrypted email, untrusted messaging channels). The json document itself is encrypted by "crypto.createCipher" and decrypted by "crypto.createDicipher". First I was some how stuck on using a private/pub

[nodejs] Free callback in node::Buffer::New

2013-06-08 Thread Bodo Kaiser
Hello, can somebody give me an example of how to use the free_callback in node::Buffer::New(char * data, size_t length, free_callback callback, void * hint)? https://github.com/joyent/node/blob/master/src/node_buffer.cc#L110 Regards, Bodo -- -- Job Board: http://jobs.nodejs.org/ Posting gui

[nodejs] Re: how to handle following use case of readable streams

2013-04-17 Thread Bodo Kaiser
itself out of the array of readers On Wednesday, April 17, 2013 10:21:24 PM UTC+2, Bodo Kaiser wrote: > > Hello, > > I have a source stream which should act as a two-byte parser (so imagine a > protocol would be defined which sets a new frame after two bytes). > > On this sou

[nodejs] how to handle following use case of readable streams

2013-04-17 Thread Bodo Kaiser
Hello, I have a source stream which should act as a two-byte parser (so imagine a protocol would be defined which sets a new frame after two bytes). On this source stream we have at least two readable streams listening which represent a two-byte frame. If the two-byte frame is reached they end.

Re: [nodejs] Does node::Buffer free foreign set memory on garbage collection?

2013-04-14 Thread Bodo Kaiser
Okay good to know thank you! Bodo Am 14.04.2013 um 20:16 schrieb Ben Noordhuis : > On Sun, Apr 14, 2013 at 8:08 PM, Bodo Kaiser wrote: >> Thanks for the hint. >> >> So the node Buffer does not free my assigned bytes when I do not use the >> free_callbac

Re: [nodejs] Does node::Buffer free foreign set memory on garbage collection?

2013-04-14 Thread Bodo Kaiser
Thanks for the hint. So the node Buffer does not free my assigned bytes when I do not use the free_callback? Bodo Am 14.04.2013 um 20:02 schrieb Ben Noordhuis : > On Sun, Apr 14, 2013 at 6:59 PM, Bodo Kaiser wrote: >> Hello, >> >> i want to know if a buffer which I have

[nodejs] Does node::Buffer free foreign set memory on garbage collection?

2013-04-14 Thread Bodo Kaiser
Hello, i want to know if a buffer which I have fed with own data is able to free this or if there is an api for manual freeing. See: https://gist.github.com/bodokaiser/5383405 Bodo -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-

Re: [nodejs] Re: C/C++ Addon: v8 does not accept node::Buffer::New()

2013-04-13 Thread Bodo Kaiser
Thanks again! Bodo. Am 13.04.2013 um 21:49 schrieb mscdex : > On Apr 13, 12:44 pm, Bodo Kaiser wrote: >> scope.Close(node::Buffer::New(chunk, 4)); > > Try this: > > scope.Close(node::Buffer::New(chunk, 4)->handle_); > > -- > -- > Job Board: http://j

[nodejs] C/C++ Addon: v8 does not accept node::Buffer::New()

2013-04-13 Thread Bodo Kaiser
Hello, I want to create a Buffer instance in a C++ Addon and export it. See: https://gist.github.com/bodokaiser/5379132 Somehow v8 does not want to except the returned value of Buffer::New because of: CXX(target) Release/obj.target/test/src/test.o ../src/test.cc:17:11: error: no matching mem

Re: [nodejs] Re: C/C++ Addon: Is argument a Buffer instance?

2013-04-13 Thread Bodo Kaiser
Thank you. This worked. https://gist.github.com/bodokaiser/5378187 Am 13.04.2013 um 14:40 schrieb mscdex : > On Apr 13, 8:27 am, Bodo Kaiser wrote: >> My current problem is that I do not know how to check if the argument is a >> buffer instance. > > Use Buffer::

[nodejs] C/C++ Addon: Is argument a Buffer instance?

2013-04-13 Thread Bodo Kaiser
Hello, I want to move my bit operations parser from Js to C(++). My current problem is that I do not know how to check if the argument is a buffer instance. GetIndexedPropertiesExternalArrayDataType() returns an enum with the types but I am not sure what to do with it... Local obj = args[0]->T

[nodejs] Re: How can I signal the end of frame in a stream

2013-04-06 Thread Bodo Kaiser
I think the only chance of solving this is to create a stream on each frame and end it with stream.end() Sorry for spamming Am 06.04.2013 um 14:16 schrieb Bodo Kaiser : > Hello, > > I have following problem: I have a stream of data frames which go through a > readable stream. I

[nodejs] How can I signal the end of frame in a stream

2013-04-06 Thread Bodo Kaiser
Hello, I have following problem: I have a stream of data frames which go through a readable stream. I now want to indicate the end of a such a frame. Currently I do this by emitting an event but this does not work if I want to pipe the data to a writable stream because the event is emitted befo

Re: [nodejs] stream: reread in order to clear own buffer cache

2013-04-04 Thread Bodo Kaiser
Sorry for the mistake. Are there any suggestions? On Wednesday, April 3, 2013 6:56:08 PM UTC+2, Forrest L Norvell wrote: > > On Wed, Apr 3, 2013 at 9:24 AM, Isaac Schlueter > > wrote: > >> That gist is a 404. > > > Delete the extra a at the end of the URL: > > https://gist.github.com/bodokaise

[nodejs] stream: reread in order to clear own buffer cache

2013-04-03 Thread Bodo Kaiser
Hello, I am trying to code a stream which can handle two sorts of byte-frames: 1. Byte-frames which are transmitted byte-after-byte 2. Byte-frames which are transmitted together (so that the chunk contains two byte-frames) My current implementation is stuck at the second point. This issue is th

Re: [nodejs] How should I unshift chunk?

2013-04-01 Thread Bodo Kaiser
fixed. > > -- > Michael Jackson > @mjackson > > > On Sun, Mar 31, 2013 at 5:14 AM, Bodo Kaiser wrote: > Hello, > > I want to unshift chunk back on the source to reparse it later on. > > Unfortunately this has brought me to following trap (I hope I have ana

[nodejs] How should I unshift chunk?

2013-03-31 Thread Bodo Kaiser
Hello, I want to unshift chunk back on the source to reparse it later on. Unfortunately this has brought me to following trap (I hope I have analyzed it correct): 1. source emits "readable" 2. A listener calls next.read(0) to start reading 3. next._read() calls "source.unshift(chunk)" 4. becau

Re: [nodejs] Re: Does stream.unshift(chunk) reexecute _read() with "chunk"?

2013-03-30 Thread Bodo Kaiser
If you wouldn't mind I would send an pull request about this documentation issue Am 30.03.2013 um 16:38 schrieb Andrew Hart : > Am Samstag, 30. März 2013 13:55:10 UTC+1 schrieb kyogron: > I am currently studying the stream api. > In the below example from the api docs "unshift" is used to reparse

[nodejs] Transforming chunked data to frames

2013-03-24 Thread Bodo Kaiser
one(); }; module.exports = WebSocketStream; Best regards, Bodo Kaiser -- -- 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. T

Re: [nodejs] Buffer changes data when using toString

2013-03-23 Thread Bodo Kaiser
Thank you for the answer. I will keep this in mind. Am 23.03.2013 um 17:24 schrieb Ben Noordhuis : > On Sat, Mar 23, 2013 at 4:33 PM, Bodo Kaiser wrote: >> Hello, >> >> I am experiencing a (in my opinion) strange behavior: >> >> var buf = crypto.randomByt

[nodejs] Buffer changes data when using toString

2013-03-23 Thread Bodo Kaiser
Hello, I am experiencing a (in my opinion) strange behavior: var buf = crypto.randomBytes(0xf); var buf2 = new Buffer(buf.toString()); // returns false buf.toString() === buf2.toString() I assume that randomBytes generates some values which cannot be encoded to `utf-8` so that they are missing

Re: [nodejs] socket closes after two minutes of idle

2013-03-04 Thread Bodo Kaiser
http://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback Worked for me! thanks great. Am 04.03.2013 um 17:22 schrieb Ben Noordhuis : > On Mon, Mar 4, 2013 at 5:17 PM, Bodo Kaiser wrote: >> Hello, >> >> I am working on another WebSocket implementation and c

[nodejs] socket closes after two minutes of idle

2013-03-04 Thread Bodo Kaiser
s Regards, Bodo Kaiser -- -- 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 nodejs

Re: [nodejs] Re: does libuv's event loop handle all callbacks?

2013-02-12 Thread Bodo Kaiser
Thank you. I will take a look. Am 12.02.2013 um 09:49 schrieb Floby : > I would recommend https://developers.google.com/v8/embed as good reading > material to understand what v8 does and does not do. > > On Monday, 11 February 2013 15:47:51 UTC+1, Bodo Kaiser wrote: >> >

Re: [nodejs] does libuv's event loop handle all callbacks?

2013-02-11 Thread Bodo Kaiser
Thank you for the hint. Will keep a look at it. Regards, Bodo Am 11.02.2013 um 18:42 schrieb Nikhil Marathe : > On Mon, Feb 11, 2013 at 9:28 AM, Bodo Kaiser wrote: >> I would also be happy with some C Tutorial :) >> > > Kernighan and Ritchie's C book is your best

Re: [nodejs] does libuv's event loop handle all callbacks?

2013-02-11 Thread Bodo Kaiser
rams. > I haven't tested programs with large data structures so I can't comment on > how the data structures in the languages scale memory wise. > > > On Mon, Feb 11, 2013 at 11:28 AM, Bodo Kaiser wrote: > I would also be happy with some C Tutorial :) > > P

Re: [nodejs] does libuv's event loop handle all callbacks?

2013-02-11 Thread Bodo Kaiser
on, Feb 11, 2013 at 10:05 AM, Bodo Kaiser wrote: >> Hello, >> >> thank you for your answer! >> >> This sounds really amazing. I hope I find the resources to understand this >> some days. >> >> Could you recommend a good tutorial for learning c(++)

Re: [nodejs] does libuv's event loop handle all callbacks?

2013-02-11 Thread Bodo Kaiser
/blob/master/lib/timers.js#L180-L214 > > Hope this helps, let me know if you have more questions. There is a lot > going on here. > > -Tim Caswell > > > > > > On Mon, Feb 11, 2013 at 8:47 AM, Bodo Kaiser wrote: > Hello, > > last weekend I

[nodejs] does libuv's event loop handle all callbacks?

2013-02-11 Thread Bodo Kaiser
Hello, last weekend I asked how nodejs event loop worked and I became a great link about it: http://nikhilm.github.com/uvbook/basics.html#event-loops Unfortunately I still got a major understanding problem about nodejs: When we use some node modules which itself look like plain javascript then

[nodejs] Re: nodejs module.js:340 throw err; using WebSocket-Node

2013-02-11 Thread Bodo Kaiser
Your link to the example does not work but I could believe that you have to change the module paths when copying the example: In the project repo of the lib: var websocket = require('../lib/index'); but when installed with npm var websocket = require('websocket'); On Monday, February 11, 2013

[nodejs] Re: which is the best way to run tests?

2013-02-11 Thread Bodo Kaiser
Hey, as you are talking about make and npm I assume your projects are written in c or c++. In this case I cannot help you but if you mean javascript modules than I can say that there a lot of tools which allow you to structure your test (such as mocha, http://visionmedia.github.com/mocha/ ).

[nodejs] Re: global authorization

2013-02-11 Thread Bodo Kaiser
This is a module specific question: you should search in the socket.io docs how to enable cross domain connections. Background of such mechanism: http://en.wikipedia.org/wiki/Same_origin_policy Am Montag, 11. Februar 2013 13:48:29 UTC+1 schrieb Mustafa Özyurt: > > Hey, > > Im using this code

[nodejs] Re: How does nodejs execute code (event loop)?

2013-02-09 Thread Bodo Kaiser
Hey, I found this section answering my question: http://nikhilm.github.com/uvbook/basics.html Thank you for sharing the links, I wish you a nice weekend. Regards, Bodo On Saturday, February 9, 2013 10:22:34 AM UTC+1, Bodo Kaiser wrote: > > Hello, > > this question is coming up

[nodejs] How does nodejs execute code (event loop)?

2013-02-09 Thread Bodo Kaiser
Hello, this question is coming up in me for a while since I have learned more and more about the features nodejs can provide. 1. I would like to know how a nodejs lifecycle looks like that mean from the kernel which is sharing events through kqueue, epoll and so on. 2. I also would like to know

[nodejs] How to handle big incoming data buffers?

2013-01-26 Thread Bodo Kaiser
etc.)? Source: https://github.com/bodokaiser/websockets Kind Regards, Bodo Kaiser -- -- 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 "nodej

Re: [nodejs] Re: http: event upgrade, how to I send a response?

2013-01-05 Thread Bodo Kaiser
Now I know what to do: You have to use socket.write("HTTP/1.1 101 Web Socket Protocol Handshake\r\n"...); actually it maybe also an idea to map the socket on a response object manually. Am 05.01.2013 um 20:25 schrieb mscdex : > kyogron, you might try using a node websocket module instead of do

Re: [nodejs] Node.js under OSX

2012-08-03 Thread Bodo Kaiser
@ryan I only can speak about my experience with FreeBSD Ports. In my opinion the work you have to put in for (administrating) compiling software and the benefits you are getting out of it are hard unbalanced. In today's time software is a lot module based. I know from my gentoo time that compi

Re: [nodejs] Re: Node.js under OSX

2012-08-03 Thread Bodo Kaiser
run into any Xcode dependency.. what are you > trying to install with Brew? > > 2012/8/3 Bodo Kaiser > Hi, > > I started with Xcode Command Line Tool support like mentioned in your link > but got stuck with some dependency of homebrew which required the full xcode >

Re: [nodejs] Re: Node.js under OSX

2012-08-03 Thread Bodo Kaiser
Hi, I started with Xcode Command Line Tool support like mentioned in your link but got stuck with some dependency of homebrew which required the full xcode IDE. Can you confirm this? Am 03.08.2012 um 15:32 schrieb Guilherme Pim : > Yep, http://kennethreitz.com/xcode-gcc-and-homebrew.html. >