Add the ability to open a file based socket. (Part of the nsITransport) code....

git-svn-id: svn://10.0.0.236/trunk@20343 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mscott%netscape.com
1999-02-11 02:59:53 +00:00
parent 45da5a7fd0
commit 36c56bfc85
3 changed files with 28 additions and 0 deletions

View File

@@ -1056,6 +1056,24 @@ NS_IMETHODIMP nsNetlibService::CreateSocketTransport(nsITransport **aTransport,
return NS_OK;
}
NS_IMETHODIMP nsNetlibService::CreateFileSocketTransport(nsITransport **aTransport, const char * aFileName)
{
NS_PRECONDITION(aFileName, "You need to specify the file name of the file you wish to create a socket for");
nsSocketTransport *pNSSocketTransport = NULL;
NS_DEFINE_IID(kITransportIID, NS_ITRANSPORT_IID);
pNSSocketTransport = new nsSocketTransport(aFileName);
if (pNSSocketTransport->QueryInterface(kITransportIID, (void**)aTransport) != NS_OK) {
// then we're trying get a interface other than nsISupports and
// nsITransport
return NS_ERROR_FAILURE;
}
return NS_OK;
}
NS_IMETHODIMP
nsNetlibService::AreThereActiveConnections()