System.Net.Mail.SmtpConnection.BeginInitializeConnection C# (CSharp) Method

BeginInitializeConnection() private method

private BeginInitializeConnection ( string host, int port, AsyncCallback callback, object state ) : IAsyncResult
host string
port int
callback AsyncCallback
state object
return IAsyncResult
        internal IAsyncResult BeginInitializeConnection(string host, int port, AsyncCallback callback, object state)
        {
            return _tcpClient.BeginConnect(host, port, callback, state);
        }

Usage Example

Esempio n. 1
0
            private void InitializeConnection()
            {
                IAsyncResult result = _connection.BeginInitializeConnection(_host, _port, InitializeConnectionCallback, this);

                if (result.CompletedSynchronously)
                {
                    try
                    {
                        _connection.EndInitializeConnection(result);
                        if (NetEventSource.IsEnabled)
                        {
                            NetEventSource.Info(this, "Connect returned");
                        }

                        Handshake();
                    }
                    catch (Exception e)
                    {
                        InvokeCallback(e);
                    }
                }
            }
All Usage Examples Of System.Net.Mail.SmtpConnection::BeginInitializeConnection