From: Adrian S. J. <as...@pa...> - 2001-07-20 08:24:38
|
> From: Paul Giotta > > I am currently have a side project that will do something like this. It > is a module that implements a telnet daemon that runs as a java thread. > When someone connects, it starts a jython interpreter and uses this as > the shell for user interaction. Thus, if this is embedded in a running > server, you can connect using an ordinary telnet client and manipulate > object running in the same VM. This is still work in progress, but some > of the sticky points so far: > > - Implementing telnet: I tried to find a java telnet daemon that I > could adapt or borrow code from. There does not seem to be any yet. Also > getting complete and understandable documentation for the telnet protocol > is not that easy (every time I use a new telnet client, it starts trying > to negotiate some other connection parameter that i cannot find in any > documentation). I've implemented telnet-like daemons in C++ and Smalltalk. The one thing I have learnt is that if you don't offer any telnet option codes, the clients tend not to try to negotiate anything. The other thing you can do is just send a WONT in response to any option you don't understand that the client sends as a DO, and a DONT when you're sent a WILL. > - If I try to run multiple instances of jython interpreters in > different threads, bad things start to happen. It is not really critical > that I handle multiple connections simultaneously, but I would not expect > this to be a problem. :-( What sort of problems? I've just got a mud-like engine running with multiple interpreters each in their own thread, and had very few problems. The hardest thing I had to do was to redirect stdout/stderr back to the telnet connection, as it seems that Jython 2.0 grabs stdout/stderr at the point that you initialise it, rather than just using Java's stdout. > -Paul Adrian. |