瀏覽單個文章
二天一流
*停權中*
 

加入日期: Aug 2020
文章: 13
放棄 3.5 改用 4.0暫時得到緩解,編譯成功測試可以用

代碼:
    public async Task SendAsync(PacketReader reader) // .Net 4.5
    改成
    public void SendAsync(PacketReader reader) // 都可以
    {
      ....
      try
      {
        await this._socket.SendTaskAsync(buffer);
        改成
        this._socket.SendTaskAsync(buffer).Wait();
      }
      catch (Exception ex1)
      {
        ....
        return;
      }
    }

    public async Task ReceiveAsync() // .Net 4.5
    改成
    public async Task ReceiveAsync() // 都可以
    {
      ....
      try
      {
        int taskAsync = await this._socket.ReceiveTaskAsync(receiveBuffer);
        改成
        this._socket.ReceiveTaskAsync(receiveBuffer).Wait();
      }
      catch (Exception ex)
      {
        ....
        return;
      }
    }
舊 2021-01-15, 11:26 PM #4
回應時引用此文章
二天一流離線中