private void OnConnection(ConnectionEvent e) { _server.EventDispatcher.ConnectionEvent -= OnConnection; LoginRequest request = new LoginRequest("user", "pass"); _server.Send(request); }
// got a response for trying to connect to the server private void OnConnection(ConnectionEvent e) { // connected or not don't need to have this anymore. since these are delegates need to be careful to remove them when not needed _server.EventDispatcher.ConnectionEvent -= OnConnection; // just pass the info through if (ConnectionEvent != null) ConnectionEvent(new Dictionary<string, object>(){ { "success", e.Success }, { "error", e.Error } }); }