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