rv = sts->CreateTransport(aHostName, aPort, nsnull, aHostName, &mTransport);
rv = sts->CreateTransport(aHostName, aPort, aHostName, &mTransport);
TestConnection::TestConnection(const char* aHostName, PRInt32 aPort,                                PRBool aAsyncFlag, PRBool testAsyncRead){  nsresult rv;  NS_INIT_REFCNT();  mIsAsync      = aAsyncFlag;  mTestAsyncOpen = testAsyncRead;  mAsyncOpenCompleted = PR_FALSE;  mBufferLength = 255;  mBufferChar   = 'a';  mBytesRead    = 0;  mTransport = nsnull;#ifndef NSPIPE2  mBuffer    = nsnull;#else  mOut       = nsnull;#endif  mStream    = nsnull;  mInStream  = nsnull;  mOutStream = nsnull;  // Create a socket transport...  NS_WITH_SERVICE(nsISocketTransportService, sts, kSocketTransportServiceCID, &rv);  if (NS_SUCCEEDED(rv)) {    rv = sts->CreateTransport(aHostName, aPort, nsnull, aHostName, &mTransport);  }  if (NS_SUCCEEDED(rv)) {    if (mIsAsync) {      // Create a stream for the data being written to the server...      if (NS_SUCCEEDED(rv)) {#ifndef NSPIPE2        rv = NS_NewBuffer(&mBuffer, 1024, 4096, nsnull);        rv = NS_NewBufferInputStream(&mStream, mBuffer);#else        rv = NS_NewPipe(&mStream, &mOut, nsnull, 1024, 4096);#endif      }    }     // Synchronous transport...    else {      rv = mTransport->OpenInputStream(0, -1, &mInStream);      rv = mTransport->OpenOutputStream(0, &mOutStream);    }  }}