Re: Sending very large chunks over the data channel

On 05/28/2014 03:54 PM, Iñaki Baz Castillo wrote:
> 2014-05-28 15:43 GMT+02:00 Harald Alvestrand <harald@alvestrand.no>:
>> On 05/28/2014 02:17 PM, Iñaki Baz Castillo wrote:
>>> 2014-05-28 14:04 GMT+02:00 Harald Alvestrand <harald@alvestrand.no>:
>>>>> This is JavaScript land. Why does not the browser just allocate space
>>>>> for *all* the data provided in send() calls and deals with EAGAIN and
>>>>> similar stuff internally? This is, send() NEVER fails, period. The
>>>>> browser holds the data and sends it when it can. The JS code still can
>>>>> check the bufferedAmount attribute in order to detect memory leaks due
>>>>> to slow sending.
>>>>
>>>> That's what the API looks like now. Until it fails, it works.
>>> Not the same. I meant "send() MUST never fail".
>
>> http://www.w3.org/TR/XMLHttpRequest/#the-send()-method doesn't agree with
>> you.
> Wow, it is obvious that those errors have *nothing* to do with what we
> were talking about in this thread:
>
> -----------------------
> XMLHttpRequest
> The send() method
>
> "Throws an "InvalidStateError" exception if the state is not OPENED or
> if the send() flag is set."
> ----------------------
>
> 1) Of course any send() method MUST fail if the socket is not open.
>
> 2) "The send() flag indicates that the send() method has been invoked.
> It is initially unset and is used during the OPENED state."
>
> This is completely different than what I meant! The above two errors
> in XMLHttpRequest may happen due to a *bad* JS code. In the other
> side, the error in DataChannel.send() may happen in runtime *once* the
> socket is open.
>
> Are you really insisting in that both errors are "similar"?

I only wished to point out that your flat statement

>> I meant "send() MUST never fail".


is simply incorrect. Even in XMLHTTPRequest, send() fails.

It's completely unclear to me what system architecture you imagine under which there is no circumstance that reasonably leads to send() failing. If you focus on describing the system architecture in your mind, that might be time better spent.

Or take a look at the system architectures of existing systems. You might find that there are reasons for this being a hard problem.

Received on Wednesday, 28 May 2014 15:36:57 UTC