Sorry, i got the topic somehow wrong in the other posts. Sorry for
being so noisy. I most should've posted the stuff more as a question
of mine than an answer :)
No problem. I guess Sungjin can do the same as you did -- browse the code for NetServer -- and rewrite the code with the NetServer architecture (which is a set of abstract classes that take care themselves of the forking), while still starting from somewhere.

You have to subclass NetServer and NetSession. NetServer listens on a socket and creates NetSessions; NetSession parses requests and passes them back to NetServer. (Note that the request is an arbitrary object, so you can pass in your case for example an association like socket->data and do "request key nextPutAll: request value")

Then, you implement your server by overriding this methods:

- in the EchoServer, #newSession (answering "EchoSession new" in your case) and #respondTo: (which takes the request association and answers as I outlined above)

- in the EchoSession, #next (which might be as easy as "self socket->self socket nextHunk")

Note that examples and documentation are what is badly needed. Sending them will never hurt.

Paolo



_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to