WebSocket connection dropped while working in extension

130 views
Skip to first unread message

Stan

unread,
Dec 13, 2011, 2:57:19 PM12/13/11
to Google Chrome Developer Tools
Hi,

I came across a strange bug, which is possibly related to the fact
that I use WebSocket client in a Chrome extension. The connection is
established in the event handler of background page body onload. It
sends and receives data well, until I do not try to send 2 messages
one by one. Example:
socket.send('id:' + id);
socket.send('url:' + URL);
This effectively drops the connection, that is even the first message
does not arrive to the server, but instead I see how the event onclose
is fired. If I send each of the messages separately, the connection
survives. If I send the same in a sinle row
socket.send('id:' + id + ' url:' + URL);
the connection survives.
No matter what the text is in the messages. I've changed it to
arbitrary strings. The result is always the same: if I call send once,
all works fine. If I try to call send twice - connection is dropped.
I'd really appreciate, if someone shed some light on this.

Thanks in advance.

Andrey Kosyakov

unread,
Dec 13, 2011, 5:53:55 PM12/13/11
to Stan, Google Chrome Developer Tools
Stan,

Could you please clarify what is being used as a WebSocket server in
your case? If it's not the chrome remote debugging server, this
question may belong elsewhere -- this group is about Chrome Developer
Tools, not Chrome development in general. If this problem only
reproduces when the code runs as an extension, you may want to try
posting to chromium-extensions.

Best regards,
Andrey.

Reply all
Reply to author
Forward
0 new messages