Exemplo n.º 1
0
 /// <summary>
 /// </summary>
 /// <param name="dataObject">
 /// </param>
 public void Send(MessageBase dataObject)
 {
     var temp = new DynamicMessage();
     temp.DataObject = dataObject;
     this.Send(temp);
 }
Exemplo n.º 2
0
        /// <summary>
        /// </summary>
        /// <param name="unpacker">
        /// </param>
        public void UnpackFromMessage(Unpacker unpacker)
        {
            // Read the type name
            this.typeName = unpacker.LastReadData.AsString();

            // Read the data object as byte array
            byte[] temp;
            unpacker.ReadBinary(out temp);

            // Create a message serializer object
            IMessagePackSingleObjectSerializer ser = MessagePackSerializer.Create(Type.GetType(this.typeName));

            // Unpack the message's data object
            this.dataObject = (MessageBase)ser.UnpackSingleObject(temp);
        }
 /// <summary>
 /// </summary>
 /// <param name="message">
 /// </param>
 public void BroadCast(MessageBase message)
 {
     foreach (IClient client in this.clients)
     {
         ((ISComV2ClientHandler)client).Send(message);
     }
 }