Akka.Interfaced.SlimSocket.Client.TcpConnection.ConnectCallback C# (CSharp) Метод

ConnectCallback() приватный Метод

private ConnectCallback ( IAsyncResult ar ) : void
ar IAsyncResult
Результат void
        private void ConnectCallback(IAsyncResult ar)
        {
            try
            {
                _client.EndConnect(ar);
                _localEndPoint = _client.Client.LocalEndPoint;
                _remoteEndPoint = _client.Client.RemoteEndPoint;
                _logger?.TraceFormat("Connected {0} with {1}", _remoteEndPoint, _localEndPoint);
            }
            catch (SocketException e)
            {
                _state = TcpState.Closed;
                _logger?.TraceFormat("Connect Failed {0} with {1}", e, _remoteEndPoint, e.SocketErrorCode);
                Closed?.Invoke(this, (int)e.SocketErrorCode);
                return;
            }
            catch (Exception e)
            {
                _state = TcpState.Closed;
                _logger?.TraceFormat("Connect Failed {0}", e, _remoteEndPoint);
                Closed?.Invoke(this, 0);
                return;
            }

            StartCommunication();
        }