Closed Bug 902704 Opened 11 years ago Closed 11 years ago

io/text-streams (and io/byte-streams) readers do not support proper handling of non-blocking streams

Categories

(Add-on SDK Graveyard :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: pellenbogen, Unassigned)

Details

Attachments

(1 file)

Attached file main.js
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0 (Beta/Release) Build ID: 20130803192641 Steps to reproduce: Run the netcat command 'nc -l 8080' and then run 'cfx run' with the given main.js. I then attempted to type 'Hello World' into netcat. Actual results: (addon-sdk)paul@paul:~/Documents/firefox_socket$ cfx run Using binary at '/usr/bin/firefox'. (process:10492): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed Using profile at '/tmp/tmp7c_4NW.mozrunner'. (process:10496): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed info: firefox_socket: info: firefox_socket: reading finished Total time: 20.157897 seconds Program terminated successfully. Expected results: There should have been a console line with the contents 'info: firefox_socket: Hello World'. This occurs if the input stream is opened with the statement transport.openInputStream(1, 0, 0); instead of the nonblocking version of the statement with all 0s as arguments. It seems like a fix may require callbacks or promises to be used instead of directly returning the string. Note: I have only tried this with text streams.
Summary: io/text-streams (and io/byte-streams) readers do not support asynchronous streams → io/text-streams (and io/byte-streams) readers do not support non-blocking streams
Summary: io/text-streams (and io/byte-streams) readers do not support non-blocking streams → io/text-streams (and io/byte-streams) readers do not support proper handling of non-blocking streams
Severity: normal → enhancement
I should amend this. Reading works as long as data is there to be read, so maybe this is a non issue, but knowing if there is data to be read still requires some work with various XPCOM objects.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: