Created
May 14, 2013 00:51
-
-
Save sclinede/5572778 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void newMessageHandler(object _sender, NewMessageEventArgs e) | |
{ | |
// Здесь вы можете обработать данное событие, e.Text - содержит текст сообщения | |
} | |
//... где-то в коде ... | |
//... там где вы инициализируете общение между желающими ... | |
Communicator MyCom = new Communicator(localPort, destIp, destPort); // Параметры, соответственно: порт для входящих соединений (1), IP того с кем связываемся (2), | |
// порт входящих соединений того с кем связываемся (3) | |
MyCom.SubscribeOnNewMessageEvent(newMessageHandler); // Оформление подписки на событие "Получено новое сообщение", обработчик приведен выше | |
MyCom.SendMessage("init"); // Пример отправки сообщения |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment