public void connectionRegained(ConnectionEventArgs a) { try { PUC.Communication.Message msg = new ServerInformationRequest(); _connection.Send(msg); } catch (Exception) { } }
/* * Member Methods */ private void connectToServer(IPAddress ipAddress) { _connection = new Connection(ipAddress, SERVER_INFO_PORT); _connection.Connect(); if (!_connection.IsConnected()) { Globals.GetDefaultLog().AddLogLine("Unable to connect to server info port."); _connection.Stop(); } else { Globals.GetDefaultLog().AddLogLine("Connected to appliance server " + _connection.GetConnectionAddr().ToString() + "."); _connection.MessageReceivedEvent += new Connection.MessageReceivedHandler(this.messageReceived); _connection.ConnectionRegainedEvent += new Connection.ConnectionRegainedHandler(this.connectionRegained); ServerInformationRequest sirmsg = new ServerInformationRequest(); _connection.Send(sirmsg); } }