[Twisted-Python] How to determine whether transport.write() succeed?
gbstack08 at gmail.com
Sun Mar 31 21:09:38 EDT 2013
I wrote a simple client and server to get system information (e.g. cpu,
Client send 'cpu' to the server, then server will return cpu's information
Now client send multiple commands to server one time, e.g. cpu, memory,
database, hard disk. But sometimes server couldn't receive some type
information (e.g. cpu, database), and the missed information type is not
fixed every time.
So I want client to check whether ITransport.write() sends message to
server successfully. If failed, client will resend the message to server.
On Sun, Mar 31, 2013 at 5:49 PM, Glyph <glyph at twistedmatrix.com> wrote:
> On Mar 31, 2013, at 1:50 AM, Todong Ma <gbstack08 at gmail.com> wrote:
> > Hi, everyone
> > How could I dertermine ITransport.write() succeed?
> > In windows socket API, I can check send()'s return value to dertermine
> whether send() succeed.
> > Any suggestion is appreciated.
> ITransport.write() always succeeds. It may or may not call socket.send
> immediately, so it cannot tell you if the socket.send() succeeded or not.
> What are you trying to do?
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python