Esempio n. 1
0
 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));
 }
Esempio n. 2
0
        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);
        }