> Hi Gloria, > > >> And ServerCore seems to be two components linked together, while the >> first example is a derivative component. >> > > I'm not sure what you mean by this. Can you explain? > Sorry, I think I confused the AdaptiveComponent with something else. Nevermind :) > >> I cannot see where an outbox is determined to default to stdout, like >> the first example, or a remote console, like the second example. Where >> in the stack is this presumed and defaulted? >> > > Neither example has any outbox that is "determined to default to stdout". > The console output in the first example is generated by the 'print' > statement(s) in it. > > The second example creates a new class derived from the ServerCore class. > This new class uses the ChatClient function as its protocol. > > One of those pipelines will be created every time a client connects > (because ServerCore calls the ChatClient function, which returns a new > instance of that pipeline). This is then wired up to communicate with the > client. This behaviour is described here: > > http://www.kamaelia.org/Components/pydoc/Kamaelia.Chassis.ConnectedServer.html > > Hopefully those docs should clear it up. I am looking for the point at which I can determine that the inbox and outbox communicate via UDP instead of TCP, for example. How a protocol is tied to an inbox or an outbox seems vague to me. The fact that it "just works" is really nice, but what if I want to change the underlying protocol?
> In short, its not "presumed or defaulted" - its what the ServerCore > component does. > > In case this is a cause of confusion, doing this: > > class ChatServer(ServerCore): > protocol = ChatClient > > ChatServer(port=1501).run() > > ...achieves basically the same thing as doing this: > > ChatServer(protocol=ChatClient, port=1501).run() > I understand this factory syntax. I guess I am thinking of protocols incorrectly in Kamaelia, and I want to make sure I get this straight. If I wanted to make CleverEchoProtocol() use a different underlying protocol, I guess I should not be digging under the hood to find out what protocol it uses currently and looking tochange it, but instead making another component which speaks the protocol of my choice, and pipeline it with this component? Let's say I need to interface directly with a device, say a serial port for example. How do I properly encapsulate this in Kamaelia? Where does the driver code get "registered"? Sorry if my questions are fuzzy. I am trying to stop thinking in twistd, where I had to do some very raw protocol handling in various spots of my interface. Because of my development history, I am so used to dealing with protocol directly that it took me a while to do this paradigm shift. Thanks again, Gloria --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "kamaelia" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/kamaelia?hl=en -~----------~----~----~----~------~----~------~--~---
