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