0

由于EndWrite没有输出,如何知道在SslStream 异步套接字中发送的数据包的大小?

    public void DataSent(IAsyncResult result)
    {
        SslStream stream = null;
        try
        {
            if (result != null)
            {
                stream = result.AsyncState as SslStream;                
                if (stream != null && stream.CanWrite)
                {
                    stream.EndWrite(result);                        
                    this.m_sendSignal.Set();

                    // how to calculate size of packet received in here ???
                }
            }
        }
        catch (Exception ex)
        {
             MessageBox.Show(ex.message);                
        }
    }
4

0 回答 0