Comments (5)
It's because you're conflating Server
with Handler
. You should have separate structs that implement these traits. Russh works with one Server
instance and multiple Handler
s.
handle_session_error
is a Server
method and you're seeing your own self-incremented <self as Server>.id
.
from russh.
In case you've used echoserver
example as the base for your code, that's on me as echoserver
omits having separate structs to keep the code shorter ✌️
from russh.
@Eugeny, thanks for the quick reply.
It's because you're conflating Server with Handler.
You are right, I am. Now that you said that the traits descriptions make more sense to me.
In case you've used echoserver example as the base for your code
ratatui_app
is the one I used as a reference since it was the most suitable to my use case. I understand the urge to keep the code shorter in the examples, but in my case this led to confusion. I'm not suggesting anything though, just sharing my experience with the lib.
from russh.
@Eugeny, I think having separate structs that implement Server
and Handler
traits might not be acceptable for my use case yet. I've just realized the server runs an infinite loop that renders the view to the connected clients (each client has own terminal handle, of course). This is exactly what ratatui_app
does and perhaps this explains the reason behind implementing both traits for one struct, i.e. AppServer
. What do you think?
from russh.
Even in this case, you still don't need it to be the same structure. The busy loop does not even reference self
(beyond using the shared clients
Arc
)
from russh.
Related Issues (20)
- 100% cpu usage when send data with channel.data HOT 6
- How to serve a basic shell #2 HOT 10
- `decode_pkcs5` does not remove padding HOT 2
- `write_key_v1` writes `ed25519` key incorrectly HOT 1
- Missing ciphers HOT 2
- Blocking API
- russh-config: Opinion: deprecate parse_home() and add crate documentation that it parses an OpenSSH-like format HOT 1
- Incorrect sha2 hash function for ecdh-sha2-nistp{384,521}
- The new `Handler` definition makes it harder to build state machines HOT 2
- Support for SCP protocol
- FEATURE REQUEST: add a Geller Field when ssh
- TryFrom<PrivateKey> for KeyPair: RSA assumes SHA512 HOT 3
- ERROR - Unsupported key type ssh-rsa HOT 2
- Host key checking is lazy
- Error with CryptoVec
- streamlocal-forward support HOT 3
- Why is String being used for Paths? HOT 1
- Unclear interaction between inactivity timer and server keepalive
- Shutdown ssh server HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from russh.