public SocketData receive() { byte[] data = new byte[79000000]; if (IsConnected) { try { Socket.Receive(data); }catch (Exception ex) { Console.WriteLine(ex); } } return((SocketData)ChatAppUtils.Deserialize(data)); }
public SocketData receive() { byte[] data = new byte[79000000]; try { ClientSocket.Receive(data); } catch (Exception e) { Console.WriteLine(e); ClientSocket.Close(); } SocketData d = (SocketData)ChatAppUtils.Deserialize(data); if (d == null) { return(new SocketData("NULLDATA", null)); } return(d); }