public async Task ReadIncomingPackets(Socket client) { try { while (client.Connected) { byte[] buffer = new byte[4096]; var segment = new ArraySegment<byte>(buffer); var read = await client.ReceiveAsync(segment,SocketFlags.None); Debug.Log(read); } } catch (System.Exception e) { Debug.Log(e); throw; } }