Hi All,

 I am trying to obtain socket descriptor from a Socket Transport
object. However, I am unable to obtain a valid descriptor, and I was
wondering if some one could point out what I am doing wrong. Here is
what I am doing to get socket descriptor:

 1. First, an nsiSocketTransport object is created in Javascript Code
using a SocketTransportService object:
var currTransport = mySockService.createTransport(null, 0,
currHostName, currPort, null);

 2. Now, I am passing currTransport to a C++ xpcom component as an
object with interface nsISocketTransport. In the C++ code, I call
GetFileDescriptor on the currTransport object.
 NS_IMETHODIMP getDescFromTransport(nsISocketTransport *sockTransport)
 {
  PRFileDesc *fd;
  ...
  if (NS_FAILED(sockTransport->GetFileDescriptor(&fd)))
        {
          return NS_OK;
        }
  ...
 }
 I noticed that after calling GetFileDescriptor, fd is set to a null
value.

 I think fd should not contain a null value and should point to the
socket descriptor for the socket connection that has been established.
Please let me know if this is the expected behaviour. Do I need to do
something more with sockTransport in order to obtain a valid file
descriptor using GetFileDescriptor()?

 Thanks,
 Abhijit

_______________________________________________
Mozilla-netlib mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to