Hi,


I am writing a javascript XPCOM component, in which I want to open a client socket connection with a server that runs TLSv1 protocol.

After connecting to the server, I get an error when I check for data
on the socket. Here is what I do:

const SocketService = Components.classes["@mozilla.org/network/socket-transport-service;1"]

.getService().QueryInterface(Components.interfaces.nsISocketTransportService);

var sock = SocketService. createTransport(["ssl"],1,"192.168.0.100", 1241,null);

var InStream = socket.openInputStream(Components.interfaces.nsITransport.OPEN_BLOCKING,0,0);
var InputStream = Components.classes["@mozilla.org/binaryinputstream;1"] createInstance(Components.interfaces.nsIBinaryInputStream);
InputStream.setInputStream(InStream);


Now when I do:

InputStream.available();

I get the following error:

uncaught exception: [Exception... "Component returned failure code: 0x80004005(NS_ERROR_FAILURE) [nsIBinaryInputStream.available]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///C:/mozilla/dist/bin/components/testComponent.js ::
_get_connection :: line 287" data: no]


I was wondering if there are some steps that I have missed i.e. after creating the socket if some SSL handshake operations are required.
I would appreciate it if someone can point out what is missing.


Thanks,
-- Abhijit

_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to