internal: JSAN socket library
authorJason Etheridge <jason@esilibrary.com>
Mon, 10 Dec 2012 11:30:33 +0000 (06:30 -0500)
committerJason Etheridge <jason@esilibrary.com>
Tue, 26 Feb 2013 16:31:43 +0000 (11:31 -0500)
commitcb9a6b5408d82814cd0534bd13bb50982a2e4bf7
tree0c059fd026bd1c2eebf3159f06a971d2e924534f
parent9c1e71a29fe9f7fca48723971bf671da7c45aa8a
internal: JSAN socket library

Leverages Mozilla's nsISocketTransportService, nsIScriptableInputStream, and
nsIInputStreamPump XPCOM, and the NetUtils javascript module.

    Usage example:

    Install netcat on a server and as root do:  nc -l -p 5000

    Then, in the staff client, load Admin -> For Developers -> Javascript Shell

    Enter:

    JSAN.use('util.socket');
    var s = new util.socket('server hostname or IP address here', 5000);
    s.write('hello\n');

    On the server, reply with world<enter>

    Back in the javascript shell, use

    s.read();

This is geared to help with implementing future functionality, but shouldn't
result in any end-user visible changes by itself.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/util/socket.js [new file with mode: 0644]