//TODO -> receive thread closing //System.ArgumentException: Obiekt IAsyncResult nie został zwrócony z odpowiedniej metody asynchronicznej w tej klasie. static void Main(string[] args) { MessengerServer server = new MessengerServer(); Thread receiveThread = new Thread(server.StartReceiving); receiveThread.Start(); server.StartListening(); }
/// <summary> /// The main entry point for the application. /// </summary> static void Main() { MessengerServer MServer= new MessengerServer(); MServer.Start(); Console.WriteLine("Messenger server is started."); Console.WriteLine("Press Enter to exit..."); Console.ReadLine(); MServer.Close(); Console.WriteLine("Messenger server shut down."); }
static void Main(string[] args) { PolicyServer policyServer = new PolicyServer("clientaccesspolicy.xml"); policyServer.Start(); Console.WriteLine("Policy server started."); MessengerServer messengerServer = new MessengerServer(); messengerServer.Start(); Console.WriteLine("Messenger server started."); Console.WriteLine("Press Enter to exit."); // Wait for an enter key. You could also wait for a specific input // string (like "quit") or a single key using Console.ReadKey(). Console.ReadLine(); policyServer.Stop(); Console.WriteLine("Policy server shut down."); messengerServer.Stop(); Console.WriteLine("Messenger server shut down."); }
public MessengerConnection(TcpClient client, string ID, MessengerServer server) { this.client = client; this.ID = ID; this.server = server; }
public MessengerConnection(Socket Client, string ID, MessengerServer server) { this.Client = Client; this.ID = ID; this.MServer = server; }