TPCServer and xdrlib
Henrique Dante de Almeida
hdante at gmail.com
Fri May 16 08:20:19 EDT 2008
On May 16, 7:16 am, Laszlo Nagy <gand... at shopzeus.com> wrote:
> Hi All,
Hello, :-)
>
> I'm trying to write a multi threaded TPC server. I have used xmlrpc
How exactly did you come to the conclusion that your server must be
multi threaded ?
> - I have to send larger amounts of data, the overhead of converting to
> XML and parsing XML back would be too much pain
- What's the expected amount of data you have to transfer ?
- What's the expected network bandwidth ?
- What's the expected acceptable transfer time ?
- How many users are expected to be transfering data at the same
time ?
> I have looked at various solutions including:
>
> - PyOrbit - too heavy weight
> - Pyro - uses pickle, I do not trust it
Did you consider gzipping your XML (or YAML) packets ? Would the
transfer time be acceptable in this case ?
>
> BTW I do not care about the clients - they must trust the server side.
Oh, he said he _doesn't care about the clients_ ! ;-)
> In contrast, the server should not receive anything from the clients
> that is dangerous. I would like to use something that is fast, and can
> only transfer data, not code. For this reason I think I cannot use the
> marshal module because it is able to marshal code objects. I think I'm
> going to implement my own "pickler" over xdrlib, that will only
> pack/unpack data, NOT code. (It would also have the advantage that
> others could write clients in different languages.)
In general I would avoid that. Try to better estimate the speed
requirements, to see if you really need do to this.
>
> Before I start re-inventing the wheel:
>
> - Is there another (already existing) higher level framework that I can
> try? It should be safe and fast, that is the only restriction.
There's "Twisted".
http://twistedmatrix.com/projects/core/documentation/howto/servers.html
> - Do you think that it is a good idea to use xdrlib? I haven't seen
> projects using it directly. For me it is like the rotor module was - it
It's probably the best way to send binary stuff over the network.
But, again, I would avoid doing so.
> was there but almost nobody used it. There might be a better lower level
> library which I don't know of.
>
> Thank you,
>
> Laszlo
More information about the Python-list
mailing list