public bool Initialize(Config birdieConfig) { // Don't allow re-use if (hasTerminated) { return(false); } // Set privileges Privileges.SetPrivileges(); // Validate the config first bool isConfigValid = birdieConfig.Validate(); if (!isConfigValid) { return(false); } Config = birdieConfig; // Create the network handler networkMain = new NetworkMain(this); // Register callbacks networkMain.OnClientConnect = ClientConnect; networkMain.OnClientDisconnect = ClientDisconnect; networkMain.OnCompleteDataReceived = DataReceived; bool isNetworkInitialized = networkMain.Start(); if (!isNetworkInitialized) { return(false); } return(true); }
private void Form1_Load(object sender, EventArgs e) { NetworkMain nm = new NetworkMain(); nm.Start(); }