GetBytes() public method

public GetBytes ( ) : byte[]
return byte[]
Exemplo n.º 1
0
 void networkNode_MessageReceived(object sender, MessageEventArgs args)
 {
     log.Append("networkNode_MessageReceived", String.Format("Message Received from {0}", args.SenderID.ToString()));
      TypedMessage message = new TypedMessage(args.Data, args.Data.Length);
      switch (message.type)
      {
     case MessageType.DescriptionRequest:
        log.Append("networkNode_MessageReceived", "Description Request received");
        DescriptionMessage description = new DescriptionMessage(CurrentServerData);
        TypedMessage reply = new TypedMessage(MessageType.DescriptionMessage, description.GetBytes());
        networkNode.SendDirect(reply.GetBytes(), args.SenderID);
        break;
     default:
        break;
      }
 }
Exemplo n.º 2
0
 private void SendAliveMessage(object ob)
 {
     TypedMessage message = new TypedMessage(MessageType.AliveMessage, BitConverter.GetBytes((Int64) DateTime.UtcNow.Ticks));
      networkNode.Send(message.GetBytes());
 }