sshnet / SSH.NET

SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.
http://sshnet.github.io/SSH.NET/
MIT License
3.97k stars 933 forks source link

How to calculate the flow? #1516

Open willhuo opened 4 days ago

willhuo commented 4 days ago

When I use ForwardedPortRemote in ssh.net ,How can I calculate send or receive datas size

Rob-Hague commented 4 days ago

You can subscribe to client.Session.ChannelOpenConfirmationReceived and inspect ChannelOpenConfirmationMessage.MaximumPacketSize. It eventually feeds through to:

https://github.com/sshnet/SSH.NET/blob/fbedaabb9c6f1d4b342acf91bc320109099c98fd/src/Renci.SshNet/Channels/ChannelForwardedTcpip.cs#L89-L91

Does that help?