[Twisted-Python] Transplating a request's transport (SockJS)

Laurens Van Houtven _ at lvh.cc
Sun Oct 28 14:40:31 MDT 2012


On Sun, Oct 28, 2012 at 9:17 PM, Glyph <glyph at twistedmatrix.com> wrote:

> Since there's no supported way to transplant a transport (see <
> http://tm.tl/3204>)... yes.
>

Aha!


> But, even if you were going to rely on undefined behavior and private
> APIs, I don't see anything in your code sample that changes anything on the
> *transport* to point at your new protocol.  So I don't see why you would
> think that it would start calling methods on it :).
>

For some reason I thought IProtocol.makeConnection did that; I guess it's
because the implementation in Protocol sets the `transport` attribute (I
thought it was the other way around).

I've set transport.protocol = myNewProtocol and now there's one extra
passing acceptance test.

I'm slowly beginning to wonder if it wouldn't be easier to write it from
scratch using t.w.websockets from the get-go...


> -g
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>


-- 
cheers
lvh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20121028/24ee2d74/attachment.html>


More information about the Twisted-Python mailing list