> >        client = getPage(url='http://localhost:8080/message_event_notify
> ',
> >method='POST',
> >            postdata=urlencode(postdata),
> >            headers={ 'Content-Type': 'application/x-www-form-urlencoded'
> }
> >)
> >        client.addCallback(self.success)
> >        client.addErrback(self.failure)
> >        reactor.run()
> >
>
> You don't need to call reactor.run() here - the reactor is already running
> (that's how the SMTP server works, after all).  In fact, you can't call
> reactor.run() here - the reactor mainloop is not reentrant.
>
> Instead, you probably want to return the "client" Deferred from
> eomReceived.
> The SMTP protocol code will use that Deferred to know when to indicate to
> the SMTP client which is talking to it when the message has been delivered
> successful or if there is an error.


OK, yes that makes sense - it works great with that change.

Thanks
James
_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to