Add socket transport support to the nsINetService interface.

git-svn-id: svn://10.0.0.236/trunk@18883 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mscott%netscape.com
1999-01-28 01:57:30 +00:00
parent 9f84532f3d
commit f92f31446c
2 changed files with 18 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ extern "C" {
#include "nsIEventQueueService.h"
#include "nsXPComCIID.h"
#include "nsCRT.h"
#include "nsSocketTransport.h"
#ifdef XP_PC
#include <windows.h>
@@ -1034,7 +1035,21 @@ nsNetlibService::CreateURL(nsIURL* *aURL,
return protocolURLFactory->CreateURL(aURL, aSpec, aContextURL, aContainer, aGroup);
}
NS_IMETHODIMP nsNetlibService::CreateSocketTransport(nsITransport **aTransport, PRUint32 aPortToUse, const char * aHostName)
{
nsSocketTransport *pNSSocketTransport = NULL;
NS_DEFINE_IID(kITransportIID, NS_ITRANSPORT_IID);
pNSSocketTransport = new nsSocketTransport(aPortToUse, aHostName);
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