Closed Bug 1106259 Opened 10 years ago Closed 8 years ago

mozTCPSocket/arraybuffer doesn't work on Desktop, Android

Categories

(Firefox for Android Graveyard :: Web Apps (PWAs), defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1057556

People

(Reporter: felix.klee, Unassigned)

Details

Browsers used for testing: * Nightly 37.0a1 (2014-11-28) on Windows 7 x64 * Possibly stable Firefox on Windows 7 x64, which I had installed in parallel and whose runtime was possibly used for the desktop app. * Firefox Beta 34.0 on Android 4.3 (ARM, x86) App types tested: * Firefox OS (in 2.0 emulator on desktop) * Desktop * Android Code to enter inside of the development console of any app privileged to use `navigator.mozTCPSocket` (e.g. my app "Trigger"): cmd = 'GET / HTTP/1.1\n\n'; arr = cmd.split('').map(function (x) { return x.charCodeAt(0); }) data = (new Uint8Array(arr)).buffer; socket = navigator.mozTCPSocket.open('mozilla.org', 80, {binaryType: 'arraybuffer'}); socket.onopen = function () { console.log('Open'); socket.send(data); }; socket.onerror = function (o) { console.log('Error', o); }; socket.ondata = function (o) { console.log('Data', o); }; Firefox OS 2.0 is the *only* tested platform where everything works as expected! The connection is opened, the request is sent, and the HTTP server responds with data: function socket.ondata() "Open" "Data" Object { _type: "data", _target: Object, _data: ArrayBuffer } For Android and Desktop apps, the connection is opened, the request is sent, but there is no response: function socket.ondata() "Open" I tried testing again today after deinstalling stable and upgrading from yesterday's to today's nighlty. However, I was notable to connect to the desktop app for testing. There were a lot of instabilities. At one point, I lost the WebIDE menu entry. On Android, I didn't yet try the latest Fennec. In short: It could be that the bug is already fixed. If that's the case, then sorry for bothering you.
I'm also seeing this issue in the v2.2 simulator (desktop).
Just tested it with Firefox for Android Nightly 37.0a1 (2015-01-05): fennec-37.0a1.multi.android-arm-2.apk Result: mozTCPSocket/arraybuffer doesn't work, i.e. the socket is opened but there is no response to the GET command. This bug breaks my apps Theta Control and Trigger. Already I got a complaint from a user: https://www.facebook.com/groups/RicohTHETAUsers/permalink/1561362024081988/
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
How is this a duplicate? Note that it worked in the past, for example with Firefox 31 on Android. Also note that the app is privileged.
Flags: needinfo?(kbrosnan)
It isn't a duplicate. Bug 1079648 is about extending mozTCPSocket support to normal web content.
Status: RESOLVED → REOPENED
Ever confirmed: true
Flags: needinfo?(kbrosnan)
Resolution: DUPLICATE → ---
Based on the example code, I believe this is probably bug 1057556 and doing socket.send(data, byteOffset, byteLength) instead of send(data) will make things work. Please dupe to bug 1057556 if that indeed does fix the problem.
Andrew, bug 1057556 is working for me now.
@asuth Thanks! `socket.send(data, 0, data.byteLength)` is a workaround. The bug is still there, just replicated it in the 2.2 simulator.
Duping for closure and all previous analysis suggesting this was bug 1057556 (which was fixed a while back by bug 885982).
Status: REOPENED → RESOLVED
Closed: 10 years ago8 years ago
Resolution: --- → DUPLICATE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.