如何知道SslStream异步套接字中发送的数据包的大小

时间:2013-03-04 01:00:10

标签: c# winforms sockets asynchronous sslstream

如何在 SslStream异步套接字中了解已发送数据包的大小,因为 EndWrite 没有输出?

    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);                
        }
    }

0 个答案:

没有答案