max-mapper / websocket-stream

websockets with the node stream API
BSD 2-Clause "Simplified" License
668 stars 114 forks source link

Cork logic fix for browsers #149

Closed scarry1992 closed 5 years ago

mcollina commented 5 years ago

I don't understand this change. It should also re-apply those changes I reverted.

Also, do you know how it fixes #148?

scarry1992 commented 5 years ago

@mcollina, I have no idea what breaks him logic. I don`t change default logic. You can see it in code.

scarry1992 commented 5 years ago

@mcollina, need more info from @binarykitchen.

scarry1992 commented 5 years ago

@mcollina, so, what we are doing?

mcollina commented 5 years ago

We wait for @binarykitchen - I had some doubt on that change from the beginning however I couldn't pinpoint the issue. Seems that change is breaking.

(This PR is not complete - it should re-revert my change).

scarry1992 commented 5 years ago

if try simple test with @binarykitchen settings - it passed

test('echo works', function(t) {
  var stream = ws('ws://localhost:8343', {objectMode: true, perMessageDeflate: false})
  stream.on('data', function(o) {
    t.ok(Buffer.isBuffer(o), 'is buffer')
    t.equal(o.toString(), 'hello', 'got hello back')
    stream.destroy()
    t.end()
  })
  stream.write(Buffer.from('hello'))
})
scarry1992 commented 5 years ago

I fixed situation @binarykitchen. But I confused, because in this case I get separate one packet on two socket frames anytime. First frame of packet: photo_2019-04-03_19-02-54 Second frame of packet: photo_2019-04-03_19-02-56 Maybe @mcollina you know what`s going on?