[Twisted-Python] Help creating a client for a custom protocol

Don Hiatt don at motorola.com
Wed Jun 25 17:50:57 EDT 2003


This is exactly what I was looking for, thanks Andrew!

Cheers,

don

P.S. Thanks also for your previous hint on restricting the web
server to single connections. 

-----Original Message-----
From: twisted-python-admin at twistedmatrix.com
[mailto:twisted-python-admin at twistedmatrix.com]On Behalf Of Andrew
Bennetts
Sent: Tuesday, June 24, 2003 9:00 PM
To: twisted-python at twistedmatrix.com
Subject: Re: [Twisted-Python] Help creating a client for a custom
protocol


On Tue, Jun 24, 2003 at 06:13:29PM -0500, Don Hiatt wrote:
> I have a custom server running a byte-oriented protocol
> (sockets, written in C) and would like to use twisted to implement
> the client. I see from looking at the "simpleclient" how


A key part is the 'struct' module in Python's standard library, which can
convert bytes to numbers, and so forth.  Take a look at the source to
twisted.protocols.basic.Int32Receiver, which receives strings prefixed by a
32-bit length.  There's really nothing to it :)




More information about the Twisted-Python mailing list