private void OnConnected(IAsyncResult result) { try { socket.EndConnect(result); base.transportState = TransportState.Connected; base.RaiseConnected(); connectCallback(this); } catch (Exception ex) { Disconnect(ex); } }