public void send(object obj)
 {
     try
     {
         ClientSocket.Send(ChatAppUtils.Serialize(obj));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         ClientSocket.Close();
     }
 }
示例#2
0
 public void send(object obj)
 {
     if (IsConnected)
     {
         try
         {
             Socket.Send(ChatAppUtils.Serialize(obj));
         } catch (Exception ex)
         {
             Console.WriteLine(ex);
         }
     }
 }