Monday, April 7, 2008

Consoles, sessions, sockets and other stuff

Safe lists slowly got some code, as per this post, and I needed to test the code... However, I am slowly getting annoyed with the impossibility to dynamically tweak the debug levels.

Hence, I used the excuse of debugging the slist code to implement stupid console service - very simple, using openssl s_client (it does not provide the fancy terminal emulation, and at the moment there is no authentication (yuck!) - but it serves its purpose.)

The presence of the "console" code allowed to start playing with various commands - first one of course was to enable/disable debugging, and then there was some lower-level stuff, like the ability to show the sockets which
are being handled at this moment:

So, here's how it looks so far:



cosimus> show sockets
Running command 'show sockets'
Sockets:
0:tcp do_ssl:0,ssl:0,listen:1,lport:2323 remote: 0.0.0.0:0 fd:3 revents:0
1:udp do_ssl:0,ssl:0,listen:1,lport:9000 remote: 127.0.0.1:28032 fd:4 revents:0
2:tcp do_ssl:0,ssl:1,listen:0,lport:0 remote: 0.0.0.0:0 fd:6 revents:1
3:udp do_ssl:0,ssl:0,listen:1,lport:9000 remote: 127.0.0.1:28288 fd:7 revents:0
4:udp do_ssl:0,ssl:0,listen:1,lport:9000 remote: 0.0.0.0:0 fd:8 revents:0
cosimus>



Simple and stupid, but serves its purpose.

As we can see, also now there is a rudimentary code to understand the concept of client sessions - such that it was possible to hook up the update routine based on the slist of the local objects (aka lobjects, for short :)

6242 lines of code, if not to count the bazillion of auto-generated stuff.

No comments: