]> git.evergreen-ils.org Git - Evergreen.git/commit
internal: JSAN socket library
authorJason Etheridge <jason@esilibrary.com>
Mon, 10 Dec 2012 11:30:33 +0000 (06:30 -0500)
committerMike Rylander <mrylander@gmail.com>
Thu, 12 Sep 2013 17:50:39 +0000 (13:50 -0400)
commit6de0fc1489856c74af2b0a5f55bb841aec74834d
treed52229737259024acbcc8c5b42c5f48bc9ce4175
parent35bbeaea9a5dfc812c82c19061d96a9c514e2b7d
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>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/xul/staff_client/chrome/content/util/socket.js [new file with mode: 0644]