On Fri, Mar 1, 2024 at 11:34 AM Michael Opdenacker <[email protected]> wrote: > > Hi Joshua and all, > > I'm going to test changes to the prserv server, to implement > "passthrough" to another server. > > I can make tests by checking the impact of my changes on the build > results, like checking the revision of generated packages. However, > would there be an easy way to make a test connection to a server based > on the bb.asyncrpc.AsyncServer class, such as hashserv or prserv? > > Feeling lucky, I tried with a plain "telnet": > > telnet 0.0.0.0 8585 > Trying 0.0.0.0... > Connected to 0.0.0.0. > Escape character is '^]'. > get-pr ethtool-6.7-r0 > Connection closed by foreign host. > > The request doesn't look that bad, as the server doesn't complain (in > the logs) but I don't get the return value. > > So, any tip for talking to a server from a terminal, or do I need a > proper client written in Python?
The protocol is all a line based-text protocol (at least for the TCP & UNIX domain sockets; websockets are another story); the basic flow is (C for client, S for Server) 1. C: <greeting and protocol version> 2. C: <0 or more lines of headers> 3. C: <empty line> 4. C: <Line of JSON encoding message> 5. S: <Line of JSON responding to message> Each line is terminated with a single newline In the (near) future, the Server will send headers back to the client between lines 3 and 4, but that's not implemented yet While you _could_ possibly manually do this using netcat (and maybe telnet? Not sure if telnet option negotiation would mess that up), it's going to be tricky to get right, so I'd recommend a python client. Also, if you want websockets I wouldn't try to do that without a client as that protocol is a lot more complicated > Cheers > Michael. > > > > -- > Michael Opdenacker, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#196548): https://lists.openembedded.org/g/openembedded-core/message/196548 Mute This Topic: https://lists.openembedded.org/mt/104671208/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
