Oliver wrote:
Hi,
lodger wrote:
Special thanks to Oliver Schmidt of Contikiprojects for fixing some issues within ContikiOS. Without your help 0.2.5 wouldn't be here today!
Thanks

Actually it's a pleasue to collaborate with you
That's mutual
Now, mistrmsk commented on it so here is something I want to tell you about the "getting it threaded" part of ContikiBBS. As you might have seen, the new version already makes use of multiple processes and simple process switching (login -> shell -> login). Then why can't the BBS come up with a "busy" message rather than hang up on the incoming connection? Well, there is a difference in the way a 'classic' BBS (using modems or serial lines) works and how ContikiBBS (using TCP/IP) works:
A 'classic' BBS can always identify which user is coming in through what line, since each modem is connected to its own serial interface. So user#1 is coming in through line#1 and user#2 threough line#2. Just use that info and you can implement a simple session handler, right?
As for 'modern' BBSes: on a Linux / UNIX system (using threads) for example, a telnet server opens a seperate session thread for each incoming telnet connection. The sessions are provided by threading the telnet server. So once again, there are concurrent sessions and the software can identify each user by their /dev/pty#, or /dev/tty#.
The telnet server Contiki provides (and ContikiBBS makes use of) does not do such a thing. It runs one session and that is provided to all incoming connections. So if you connect to the original (Contiki) telnet server and someone else is already logged in, both of you share the same session. If user#1 types a command, user#1 *and* user#2 will see the output of it. And if user#2 runs a command, user#1 will receive its output too. So as a result, if I would just add a neat little
Code:
shell_output_str(&shell_process, "bbs is busy\n", "");
the person that is already logged in will also receive the message. It's somewhat disturbing, I think, so this is the plain simple reason why ContikBBS acts rather rude when it's busy.

I will not make the same mistake twice, stating that making it work a different way is impossible since the Contiki webserver is already threaded. But it is impossible for me to get that job done. If someone feels like it, they're welcome to have a look at the webserver code and use that as a basis for a new, fully threaded telnet server. Still, I wonder how much memory will be left on a C64 or Apple ][ for real BBS processes once such a server is finished. Again: I'd be the first person who would adapt to such a codebase if it exsisted. Currently, it does not and I just don't have the skills to do it - so I stick to what is possible at the moment. Even if that includes "rude behaviour"

Also on my whish list for the interested developer is a simple compression algorithm, which could improve the amount of text that can be stored per posting. If you just finisehd writing such a masterpiece in C and want to share it, feel free to do so. I'll be happy to use it!