Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static string user_to = "test8";
- static void GetMsgLoop()
- {
- while(true)
- {
- string str = MessengerInterop.GetMessage();
- Console.WriteLine("Message received: " + str);
- }
- }
- static void SendMsgLoop()
- {
- string msg;
- while (true)
- {
- msg = Console.ReadLine();
- byte[] username_bytes = Encoding.UTF8.GetBytes(user_to);
- byte[] msg_bytes = Encoding.UTF8.GetBytes(msg);
- MessengerInterop.SendMessage(username_bytes, msg_bytes);
- }
- }
- Thread GetMsgThread = new Thread(GetMsgLoop);
- Thread SendMsgThread = new Thread(SendMsgLoop);
- GetMsgThread.Start();
- SendMsgThread.Start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement