示例#1
0
 public string GetMessage(Message transfer)
 {
     string message = string.Empty;
     if (transfer.Method == TransferMethod.REQUEST) {
         message = $"{Name} {transfer.Method} {(transfer as Request).Status} {transfer.DataType} {transfer.Data}";
     } else {
         message = $"{Name} {transfer.Method} {(transfer as Response).Status} {transfer.DataType} {transfer.Data}";
     }
     return message;
 }
示例#2
0
 public void Send(Message transfer)
 {
     Socket.Send(Encoding.GetBytes(GetMessage(transfer)));
 }