You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just calling attention to there not really being thorough documentation on how to make a server that isn't SCP or SFTP.
I realized this because I wanted to try and make one of those basic "chat app" demos and got lost.
For one, just having server.start(); does not seem to work and the JVM will just exit. I needed to put a spurrious while (true) {} to keep everything alive.
The server has createContext, which I think is where I need to look to (mapping to the createContext on the sun http server, this feels like the place to attach a handler) but I feel like I lack context on how to construct and utilize the arguments - SshEngineContext daemonContext, SocketChannel sc
The text was updated successfully, but these errors were encountered:
I had a draft document for creating an interactive terminal which I have now put live. Whilst this is not a tutorial to create a chat application, it shows the best way to implement a terminal commands, which could quite easily be adapted to a chat type application.
I would suggest you start with writing a chat command that can read from the chat database and display messages, and that can send messages from what the user types. To start it, just log in to the terminal and type chat to start.
If you manage to do that and then want the user to enter that command immediately without typing it, there is probably a way to do so, just ask. :|
The server is asynchronous by nature, having start block is not ideal for many solutions so you have to handle this yourself if your putting in in a basic application. However, this is catered for in the shutdown future object. Just use this to wait for the server to shutdown (this assumes some other thread will shut it down or the process terminates).
Just calling attention to there not really being thorough documentation on how to make a server that isn't SCP or SFTP.
I realized this because I wanted to try and make one of those basic "chat app" demos and got lost.
For one, just having
server.start();
does not seem to work and the JVM will just exit. I needed to put a spurriouswhile (true) {}
to keep everything alive.The server has
createContext
, which I think is where I need to look to (mapping to thecreateContext
on the sun http server, this feels like the place to attach a handler) but I feel like I lack context on how to construct and utilize the arguments -SshEngineContext daemonContext, SocketChannel sc
The text was updated successfully, but these errors were encountered: