Re: [nodejs] Buffer to ArrayBuffer and vice versa

2014-10-23 Thread Denys Khanzhyiev
Why memcpy does not work? It was working recently. What version of node do you use? 2014-10-23 16:29 GMT+03:00 Michael Wittig michael.wit...@tullius-walden.com : Hi, I need to convert a Buffer to an ArrayBuffer and vice versa. Is it possible to do so that without copying mem? npm memcpy

Re: [nodejs] Is it possible yet to use cluster and UDP on Windows environment.

2014-06-21 Thread Denys Khanzhyiev
BTW I have discovered that named pipes are working in Node under Windows and give bigger transfer rates than tcp. Thought haven't tried it with cluster. 2014-06-21 12:25 GMT+03:00 Ben Noordhuis i...@bnoordhuis.nl: On Sat, Jun 21, 2014 at 5:32 AM, Ket kettin...@gmail.com wrote: Base on my

Re: [nodejs] Is it possible yet to use cluster and UDP on Windows environment.

2014-06-21 Thread Denys Khanzhyiev
UDP does not guarantee transmition of data. I personally experience data loss starting from specific Data rate on UDP broadcast on loopback inetrface unde Win7 x64. And this is pretty low number - about 8 Mbit for me. 2014-06-21 6:32 GMT+03:00 Ket kettin...@gmail.com: Base on my google

[nodejs] Re: Buffer and typed arrays, documentation

2014-06-15 Thread Denys Khanzhyiev
= i2; dest[i] = ((b[o]) | (b[o + 1] 8) | (b[o + 2] 16)) + (b[o + 3] * 0x100); } What is strange - that using Uint8Array to copy data from Buffer to ArrayBuffer in a loop is much slower. 2014-06-14 16:25 GMT+03:00 Denys

Re: [nodejs] Buffer and typed arrays, documentation

2014-06-15 Thread Denys Khanzhyiev
Yes I understand what is happening. I just thought there is another special way of A Buffer object can also be used with typed arrays that I am not aware of. 2014-06-15 7:03 GMT+03:00 Trevor Norris trev.nor...@gmail.com: It's copying each octet from the Buffer to the ArrayBuffer. Despite the

[nodejs] Buffer and typed arrays, documentation

2014-06-14 Thread Denys Khanzhyiev
Hello, I am in search of most efficient way to convert Buffer to ArrayBuffer. Can somebody explain this paragraph: A Buffer object can also be used with typed arrays. The buffer object is cloned to an ArrayBuffer that is used as the backing store for the typed array. The memory of the buffer and

Re: [nodejs] does os.networkInterfaces work in windows

2014-06-08 Thread Denys Khanzhyiev
Just checked on Win 8.1 node 10.28 - works. 2014-06-08 7:23 GMT+03:00 Mark Hahn m...@hahnca.com: I'm running as administrator. I'm on win 8.0 so it should be the same as Win 7. I'll do experiments on other PCs. On Saturday, June 7, 2014 4:12:57 PM UTC-7, Denys Khanzhiyev wrote: In

Re: [nodejs] does os.networkInterfaces work in windows

2014-06-07 Thread Denys Khanzhyiev
In 10.24 and 10.28 works for me under Win 7. 2014-06-07 2:45 GMT+03:00 Mark Hahn m...@hahnca.com: When I run os.networkInterfaces() in node 10.25 I get the result [ null ]. Is there something I have to do to use this in windows? -- Job board: http://jobs.nodejs.org/ New group rules:

Re: [nodejs] Poor WriteStream Performance

2014-05-20 Thread Denys Khanzhyiev
1. Your async code is incorect as you close file before all write operation complete. 2. WriteStream buffers written data until other end is ready to consume data. So you actually first fill memory with data and then write it to file. 2014-05-20 20:29 GMT+03:00 Jeff Jolma jjo...@gmail.com:

Re: [nodejs] Poor WriteStream Performance

2014-05-20 Thread Denys Khanzhyiev
Or even simplier (function doWrite(){ if(i--) stream.write(DUMMY_MESSAGE,doWrite); else stream.end(''); })(); 2014-05-20 22:45 GMT+03:00 Denys Khanzhyiev xden...@gmail.com: this variant is more efficient. function benchmarkWriteStream() { const stream = fs.createWriteStream

Re: [nodejs] Poor WriteStream Performance

2014-05-20 Thread Denys Khanzhyiev
this variant is more efficient. function benchmarkWriteStream() { const stream = fs.createWriteStream( './dummyWriteStream.log', { encoding: utf8, mode: parseInt('0644', 8) } ); const startTime = new Date(); var i = NUM_WRITES; (function doWrite(){ if(i--) {

Re: [nodejs] Poor WriteStream Performance

2014-05-20 Thread Denys Khanzhyiev
times slower. 2014-05-20 22:59 GMT+03:00 Denys Khanzhyiev xden...@gmail.com: Or even simplier (function doWrite(){ if(i--) stream.write(DUMMY_MESSAGE,doWrite); else stream.end(''); })(); 2014-05-20 22:45 GMT+03:00 Denys Khanzhyiev xden...@gmail.com: this variant is more

[nodejs] UDP multicast over loopback inteface

2014-05-19 Thread Denys Khanzhyiev
Hello, I need to distribute about 100Mbit data stream among several applications locally. So I have decided to use UDP multicats on loopback interface. In general this works except the data loss. So I have created simple sending and receiving app.

Re: [nodejs] Memory leak with Buffer.toArrayBuffer

2014-05-13 Thread Denys Khanzhyiev
Yes It was me who started the process: https://github.com/joyent/node/pull/6337 see comments below. 2014-05-13 4:47 GMT+03:00 mscdex msc...@gmail.com: On Monday, May 12, 2014 3:44:23 PM UTC-4, Denys Khanzhiyev wrote: Is it worth of creating issue? Not really, it looks like it was

[nodejs] Memory leak with Buffer.toArrayBuffer

2014-05-12 Thread Denys Khanzhyiev
the code: var buf = new Buffer(1024*1024); setInterval(function(){ var ab = buf.toArrayBuffer(); var b = new Uint8Array(ab); },10); quickly eats memory and crashes node. Invoking it every 20 or 100 ms just prolongates agony. Originally found in Node WebKit reproduced in node 0.11.13 Is it

Re: [nodejs] playing an MP4 video in node.js express

2014-05-11 Thread Denys Khanzhyiev
Express should serve video files just fine with static middleware and with support of ranges. It looks like your problem is on client side. 2014-05-11 6:33 GMT+03:00 Jake Wolpert jakeci...@gmail.com: I thought I could get away without streaming at first. Some browsers only like streaming, so

Re: [nodejs] Re: browserify based firebird client using webtcp

2014-02-17 Thread Denys Khanzhyiev
I think you should create file exportfb.js: window.fb = require('node-firebird'); and then browserify exportfb.js browser-index.js then try exmaple w/o line var fb = require(node-firebird); 2014-02-17 18:45 GMT+02:00 Adrian Marius Popa map...@gmail.com: I forgot the example

Re: [nodejs] Re: node-firebird-libfbclient updated for node v0.10.25

2014-02-16 Thread Denys Khanzhyiev
Hi Paul, You will not be able to use neither node-firebird-libfbclient nor node-firebird directly from browser as these modules are designed to work in nodejs, not in browser. 2014-02-15 23:14 GMT+02:00 Paul Ruddlesdin p...@ruddlesdin.com: Hi, I am looking for some help with this module. I

Re: [nodejs] Re: help with streams

2014-02-14 Thread Denys Khanzhyiev
I have finally found what is wrong. Readable.push() may call _read again synchrnously so whole thing becomes recursive and buffers are swapped as I am adjusting position after call to push. 2014-02-12 18:50 GMT+02:00 Denys Khanzhyiev xden...@gmail.com: It looks like reading from growing file

Re: [nodejs] Re: help with streams

2014-02-12 Thread Denys Khanzhyiev
, and reading still gets wrong data. How can I detect what part of file it is safe to read? 2014-02-12 9:16 GMT+02:00 Denys Khanzhyiev xden...@gmail.com: Thank you Michael, Yes return is missing before setTimeout. I have updated gist. But that does not change result. https://gist.github.com

[nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
Looks like it is not solved. Sometimes I get situation when fs.ReadStrem neither emit 'readable' nor 'end' when used on growing file in non flow mode. And I have no event to resume reading. Except maybe some timeout. 2014-02-08 19:53 GMT+02:00 Denys Khanzhyiev xden...@gmail.com: Solved

[nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
Or maybe I understand it wrong. When I call fs.ReadStream.read should I expect it will emit 'end' during call? Ok it is better to look in sources. 2014-02-11 11:27 GMT+02:00 Denys Khanzhyiev xden...@gmail.com: Looks like it is not solved. Sometimes I get situation when fs.ReadStrem neither

[nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
This is not funny now. I am not able to make such simple thing. Now I am getting swapped chunks of data. https://gist.github.com/xdenser/8887437 when new read stream starts first 2 chunks of data are swapped. How is it possible? 2014-02-11 11:50 GMT+02:00 Denys Khanzhyiev xden...@gmail.com

Re: [nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
Ok I have created simple gist to test this. https://gist.github.com/xdenser/8944752 Just run file and you should see WTF! 49152 WTF! 114688 WTF! 180224 WTF! 245760 ... WTF! 4112384 writeStream finish WTF! 4177920 read Stream Finished if you see just writeStream finish read Stream Finished it

Re: [nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
same v0.10.15 Ubuntu 13.10 on ARMv9 2014-02-11 23:48 GMT+02:00 Denys Khanzhyiev xden...@gmail.com: Ok I have created simple gist to test this. https://gist.github.com/xdenser/8944752 Just run file and you should see WTF! 49152 WTF! 114688 WTF! 180224 WTF! 245760 ... WTF! 4112384

Re: [nodejs] Re: help with streams

2014-02-11 Thread Denys Khanzhyiev
Thank you Michael, Yes return is missing before setTimeout. I have updated gist. But that does not change result. https://gist.github.com/xdenser/8944752 I think this is small enough. What I am trying to acheeve is to create CatchStream - a stream reading from growing file, where growing file is

[nodejs] Re: help with streams

2014-02-08 Thread Denys Khanzhyiev
. 2014-02-08 2:12 GMT+02:00 Denys Khanzhyiev xden...@gmail.com: Hello, I have a task where one slow stream is piped to fs.writeStream and after some event I need to read from that writen file, i.e. read from growing file from some position. A have seen `node-growing-file`, and `tailing-stream

[nodejs] help with streams

2014-02-07 Thread Denys Khanzhyiev
Hello, I have a task where one slow stream is piped to fs.writeStream and after some event I need to read from that writen file, i.e. read from growing file from some position. A have seen `node-growing-file`, and `tailing-stream` nothing seems to solve my problem. It looks like I do not