1 write to connection
System (1)
net\System\Net\mail\smtpconnection.cs (1)
593this.connection = connection;
93 references to connection
System (93)
net\System\Net\mail\smtpconnection.cs (93)
613while (pooledStream.creds != null && pooledStream.creds != ConnectAndHandshakeAsyncResult.connection.credentials) { 615ConnectAndHandshakeAsyncResult.connection.connectionPool.PutConnection(pooledStream, 616pooledStream.Owner, ConnectAndHandshakeAsyncResult.connection.Timeout, false); 617pooledStream = (SmtpPooledStream)ConnectAndHandshakeAsyncResult.connection.connectionPool.GetConnection((object)ConnectAndHandshakeAsyncResult, ConnectAndHandshakeAsyncResult.m_ConnectionCreatedCallback, ConnectAndHandshakeAsyncResult.connection.Timeout); 623if (Logging.On) Logging.Associate(Logging.Web, ConnectAndHandshakeAsyncResult.connection, pooledStream); 624pooledStream.Owner = ConnectAndHandshakeAsyncResult.connection; //needs to be updated for gc reasons 625pooledStream.creds = ConnectAndHandshakeAsyncResult.connection.credentials; 628lock (ConnectAndHandshakeAsyncResult.connection) { 631if (ConnectAndHandshakeAsyncResult.connection.isClosed) { 632ConnectAndHandshakeAsyncResult.connection.connectionPool.PutConnection(pooledStream, pooledStream.Owner, ConnectAndHandshakeAsyncResult.connection.Timeout, false); 637ConnectAndHandshakeAsyncResult.connection.pooledStream = pooledStream; 663if (connection.isConnected) 669SmtpPooledStream pooledStream = (SmtpPooledStream)connection.connectionPool.GetConnection((object)this, (synchronous ? null : m_ConnectionCreatedCallback), connection.Timeout); 675while (pooledStream.creds != null && pooledStream.creds != connection.credentials) { 677connection.connectionPool.PutConnection(pooledStream, pooledStream.Owner, connection.Timeout, false); 678pooledStream = (SmtpPooledStream)connection.connectionPool.GetConnection((object)this, (synchronous ? null : m_ConnectionCreatedCallback), connection.Timeout); 684pooledStream.creds = connection.credentials; 685pooledStream.Owner = this.connection; //needs to be updated for gc reasons 687lock (connection) { 688connection.pooledStream = pooledStream; 703connection.responseReader = new SmtpReplyReaderFactory(connection.pooledStream.NetworkStream); 709connection.pooledStream.UpdateLifetime(); 711if (((SmtpPooledStream)connection.pooledStream).previouslyUsed == true) { 712connection.isConnected = true; 718SmtpReplyReader reader = connection.Reader.GetNextReplyReader(); 756LineInfo info = thisPtr.connection.Reader.CurrentReader.EndReadLine(result); 784IAsyncResult result = EHelloCommand.BeginSend(connection, connection.client.clientDomain, sendEHelloCallback, this); 787connection.extensions = EHelloCommand.EndSend(result); 788connection.ParseExtensions(connection.extensions); 792if (connection.pooledStream.NetworkStream is TlsStream) 798if (connection.EnableSsl) { 800if (!connection.serverSupportsStartTls) 803if (!(connection.pooledStream.NetworkStream is TlsStream)) 831thisPtr.connection.extensions = EHelloCommand.EndSend(result); 832thisPtr.connection.ParseExtensions(thisPtr.connection.extensions); 837if (thisPtr.connection.pooledStream.NetworkStream is TlsStream) 857if (thisPtr.connection.EnableSsl) { 859if (!thisPtr.connection.serverSupportsStartTls) 862if (!(thisPtr.connection.pooledStream.NetworkStream is TlsStream)) 886IAsyncResult result = HelloCommand.BeginSend(connection, connection.client.clientDomain, sendHelloCallback, this); 890connection.supportedAuth = SupportedAuth.Login; 918IAsyncResult result = StartTlsCommand.BeginSend(connection, SendStartTlsCallback, this); 923connection.pooledStream.ServicePoint.Host, 924connection.pooledStream.NetworkStream, 927connection.ClientCertificates, 928connection.pooledStream.ServicePoint, 929connection.client, 931connection.pooledStream.NetworkStream = TlsStream; 932connection.responseReader = new SmtpReplyReaderFactory(connection.pooledStream.NetworkStream); 948thisPtr.connection.pooledStream.ServicePoint.Host, 949thisPtr.connection.pooledStream.NetworkStream, 952thisPtr.connection.ClientCertificates, 953thisPtr.connection.pooledStream.ServicePoint, 954thisPtr.connection.client, thisPtr.m_OuterResult.ContextCopy); 955thisPtr.connection.pooledStream.NetworkStream = TlsStream; 956thisPtr.connection.responseReader = new SmtpReplyReaderFactory(thisPtr.connection.pooledStream.NetworkStream); 971if (connection.credentials != null) { 972while (++currentModule < connection.authenticationModules.Length) 975ISmtpAuthenticationModule module = connection.authenticationModules[currentModule]; 976if (!connection.AuthSupported(module)) { 980NetworkCredential credential = connection.credentials.GetCredential(host, port, module.AuthenticationType); 983Authorization auth = connection.SetContextAndTryAuthenticate(module, credential, m_OuterResult); 987IAsyncResult result = AuthCommand.BeginSend(connection, connection.authenticationModules[currentModule].AuthenticationType, auth.Message, authenticateCallback, this); 1005module.CloseContext(connection); 1006connection.isConnected = true; 1018connection.isConnected = true; 1041thisPtr.connection.authenticationModules[thisPtr.currentModule].CloseContext(thisPtr.connection); 1042thisPtr.connection.isConnected = true; 1062Authorization auth = connection.authenticationModules[currentModule].Authenticate(authResponse, null, connection, connection.client.TargetName, connection.channelBindingToken); 1068IAsyncResult result = AuthCommand.BeginSend(connection, auth.Message, authenticateContinueCallback, this); 1077connection.authenticationModules[currentModule].CloseContext(connection); 1078connection.isConnected = true; 1100thisPtr.connection.authenticationModules[thisPtr.currentModule].CloseContext(thisPtr.connection); 1101thisPtr.connection.isConnected = true;