python streaming TCP server with RPC
- by Noah
I have written a little streaming mp3 server in python. So far all it does is accept a ServerSocket connection, and begin streaming all mp3 data in its queue to the request using socket.send(). I have implemented this to chunk in stream icy metadata, so the name of the playing song shows up in the client.
I would like to add playlist management to the server, so that I can manipulate the playlist of the running server. I have a vague idea that xmlrpclib would be suited to doing this, but I'm confused about one thing:
When I start the server it listens on port N. The python xmlrpclib examples involve creating a socket and listening for requests. So my question is should server listen on two ports; i.e., one for streaming client requests and one for xmlrpclib calls, or is there a way to do it by somehow delegating the request to the appropriate handler based on its type?