Exemple #1
0
 public static void writeMessage(TcpClient client, AbstractMessage message)
 {
     StreamWriter writer = new StreamWriter(client.GetStream());
     writer.Write(message.toXml().InnerXml.ToString());
     writer.Flush();
     //writer.Close();
 }
Exemple #2
0
 public void receiveMessage(AbstractMessage message)
 {
     ChatMessage chatMessage = (ChatMessage)message;
     rtChat.AppendText(
         String.Format("{0} => {1} : {2}",
         chatMessage.from.name,
         chatMessage.to.name,
         chatMessage.content)
     );
 }
Exemple #3
0
 public void update(AbstractMessage message)
 {
     ChatMessage msg = (ChatMessage) message;
     rtChat.AppendText(msg.content+"\n");
 }
Exemple #4
0
 public void receiveMessage(AbstractMessage message)
 {
     throw new System.NotImplementedException();
 }
Exemple #5
0
 public void sendMessageOut(AbstractMessage message)
 {
     serverConnection.queueMessageOut(message);
 }
Exemple #6
0
 public void writeMessage(AbstractMessage message)
 {
     writeMessage(client, message);
 }
Exemple #7
0
 /// <summary>
 /// Adds message into the incoming message queue
 /// </summary>
 /// <param name="message">Message object to be send</param>
 public void queueMessageIn(AbstractMessage message)
 {
     messageQueueIn.Enqueue(message);
 }
Exemple #8
0
 /// <summary>
 /// Add message into the outgoing message queue
 /// </summary>
 /// <param name="message">Message to queue</param>
 public void queueMessageOut(AbstractMessage message)
 {
     messageQueueOut.Enqueue(message);
 }
Exemple #9
0
 public void send(AbstractMessage message)
 {
     model.send(message);
 }