apps using TCP server socket do not work if updated from dev tools, require manual quit on phone before restart



Firefox OS
4 years ago
3 months ago


(Reporter: Jason Proctor, Unassigned)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



4 years ago
Created attachment 8476225 [details]

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2121.3 Safari/537.36

Steps to reproduce:

i'm essentially trying to write an HTTP server using TCPServerSocket. i took a look at the TCP server socket tester (test_tcpserversocket.js) and developed my app around its pattern. i'm using TCPServerSocket to listen on port 555 and essentially log what happens from there.

Actual results:

i'm seeing inconsistent behaviour and so far have not seen correct behaviour. usually the server closes the connection immediately on acceptance, and does not call any event handlers. sometimes the server calls my onconnect handler, sometimes not. rarely, the connected socket's ondata handler is called, before the socket is closed. also rarely, the connected socket is kept open, but no event handlers are called. when connecting using telnet from a command line on a machine on the same network, the connection is immediately closed upon acceptance and no event handlers are called.

Expected results:

when an incoming connection is accepted, the server socket should call the onconnect event handler, passing the socket resulting from the accept() call (note the documentation is wrong in this respect). the connected socket should then be able to communicate with the other endpoint, with data being sent and received as appropriate.
Which gecko version where you using? Also, was this on a device or on the desktop?

Comment 2

4 years ago
sorry for the omission of such details. this is the Flame device on Boot2Gecko platform version 34.0a1, build ID 20140724143109.

i can't currently build b2g due to the time_daemon copy issue in the device backup. even installing fresh products from a colleague doesn't sort my build. if there's a way round it then i'd love to hear it -- or i could file an issue for it.
OS: All → Gonk (Firefox OS)

Comment 3

4 years ago
seems like this might be fixed in the Aug 24 nightly - thanks for posting Flame builds, btw

Comment 4

4 years ago
it's partially fixed - if i quit the app and debug it from the app manager, then it will work once. if i then reinstall and debug from the app manager, it fails. quitting the app manually and going back in will restart the cycle.

Comment 5

4 years ago
as of build identifier 20140922040204, this issue persists. with the app up, updating it from the app manager breaks its ability to accept TCP connections. if the app is restarted on the phone restores functionality.


4 years ago
Summary: cannot conduct successful communication using TCP server socket → apps using TCP server socket do not work if updated from dev tools, require manual quit on phone before restart

Comment 6

3 months ago
Firefox OS is not being worked on
Last Resolved: 3 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.