Re: [Twisted-Python] How to get caller’s IP address in Perspective Broker server

2017-01-16 Thread Oon-Ee Ng
On Mon, Jan 16, 2017 at 10:15 PM, Роман Мещеряков wrote: > Hi everyone! I’m new to Twisted and mailing lists, so please excuse me if I > make some mistake. My question maybe trivial, but as far as I know it is > neither explained on the twistedmatrix.com web site nor easily resolved > using Google

Re: [Twisted-Python] conch problem with ecdsa-sha2-nistp256 host key?

2016-12-01 Thread Oon-Ee Ng
http://twistedmatrix.com/pipermail/twisted-python/2016-October/030819.html On Fri, Dec 2, 2016 at 9:11 AM, Craig Rodrigues wrote: > Hi, > > I filed this bug: > https://twistedmatrix.com/trac/ticket/8931 > > At least for me, conch fails to parse a host key created by OpenSSH > in ~/.ssh/known_host

Re: [Twisted-Python] Conch examples give me host key related errors

2016-10-09 Thread Oon-Ee Ng
Oh and it seems tab completion was being worked on but that's been left waiting for a while now - https://twistedmatrix.com/trac/ticket/6863 Still fantastically useful without though, so no complaints there. On Mon, Oct 10, 2016 at 10:55 AM, Oon-Ee Ng wrote: > A reply from Amber herself

Re: [Twisted-Python] Conch examples give me host key related errors

2016-10-09 Thread Oon-Ee Ng
f -- we should update these examples to add this, so > that they run out of the box again. > > - Amber > > On 10 Oct. 2016, at 13:05, Oon-Ee Ng wrote: > > My google-fu is failing me (or I'm the only one with a misconfigured > ssh system), but none of the examples on >

[Twisted-Python] Conch examples give me host key related errors

2016-10-09 Thread Oon-Ee Ng
My google-fu is failing me (or I'm the only one with a misconfigured ssh system), but none of the examples on http://twistedmatrix.com/documents/current/conch/examples/index.html run for me. The ConchError I'm mostly getting says ('no host keys, failing', None), while the simplesshserver.py exampl

Re: [Twisted-Python] inlineCallbacks as a blocking approximator (stylistic)

2016-10-03 Thread Oon-Ee Ng
On Tue, Oct 4, 2016 at 1:03 PM, Manish Tomar wrote: > I was on synchronous mindset before learning Twisted and did not > like/understand Deferred. The `yield` based statement really helped me > initially but more importantly over time I liked seeing an explicit > difference between blocking vs non

Re: [Twisted-Python] inlineCallbacks as a blocking approximator (stylistic)

2016-10-03 Thread Oon-Ee Ng
On Tue, Oct 4, 2016 at 12:42 PM, meejah wrote: > Oon-Ee Ng writes: > >> The closest I'm able to come to that so far is for my function to be >> decorated with @defer.inlineCallbacks which will then look like this >> >> val = yield doSomeCallRemoteCallHe

[Twisted-Python] inlineCallbacks as a blocking approximator (stylistic)

2016-10-03 Thread Oon-Ee Ng
First off, I've read [1] and am not trying to convert twisted code into blocking code (well, I WAS, but have reconsidered). I've got Kivy code using twisted code without much problem, but really hated defining many in-line functions/lambdas for simple 'assign the result to a Kivy widget' style thi

Re: [Twisted-Python] AMP message length limit

2015-11-28 Thread Oon-Ee Ng
On Sat, Nov 28, 2015 at 10:41 PM, Glyph Lefkowitz wrote: > > On Nov 25, 2015, at 04:54, Oon-Ee Ng wrote: > > On Tue, Nov 24, 2015 at 11:03 AM, Oon-Ee Ng wrote: > > And furthermore that when I do that, callRemote no longer returns a > deferred (which makes sense, really) an

Re: [Twisted-Python] AMP message length limit

2015-11-25 Thread Oon-Ee Ng
On Tue, Nov 24, 2015 at 11:03 AM, Oon-Ee Ng wrote: > And furthermore that when I do that, callRemote no longer returns a > deferred (which makes sense, really) and instead gets a None. One more > check before I add my default errBacks then. Optimised network traffic > sounds posi

Re: [Twisted-Python] AMP message length limit

2015-11-23 Thread Oon-Ee Ng
On Tue, Nov 24, 2015 at 10:58 AM, Oon-Ee Ng wrote: > On Tue, Nov 24, 2015 at 9:16 AM, Oon-Ee Ng wrote: >> >> Thanks, right now I just have plenty of return {} everywhere. Does >> requiresAnswer=False mean less bandwidth usage (no need to transmit an >> empty

Re: [Twisted-Python] AMP message length limit

2015-11-23 Thread Oon-Ee Ng
On Tue, Nov 24, 2015 at 9:16 AM, Oon-Ee Ng wrote: > > Thanks, right now I just have plenty of return {} everywhere. Does > requiresAnswer=False mean less bandwidth usage (no need to transmit an > empty dict)? Having read the documentation a bit, it appears requiresAnswer=False is a

Re: [Twisted-Python] AMP message length limit

2015-11-23 Thread Oon-Ee Ng
On Mon, Nov 23, 2015 at 8:54 AM, Glyph Lefkowitz wrote: > I'm sorry that this was an unpleasant surprise. I wish that we had a better > way of getting this across up-front :-). However, it seems like the length > limit is doing its job in terms of constraining your protocol design to not > have

[Twisted-Python] AMP message length limit

2015-11-22 Thread Oon-Ee Ng
I've just (to my surprise) hit this. As I understand from searching around, AMP messages are limited to ~64k due to the length prefix being 16-bit. A change in my internal data being sent (using dicts rather than lists) kicked one of my messages to way over that limit. There's a bit of discussion

Re: [Twisted-Python] Multiple reactors, connecting to self, or other solution?

2015-11-20 Thread Oon-Ee Ng
On Fri, Nov 20, 2015 at 1:22 PM, Glyph Lefkowitz wrote: >> On Nov 19, 2015, at 9:19 PM, Oon-Ee Ng wrote: >> >> On Wed, Nov 18, 2015 at 4:55 PM, Glyph Lefkowitz >> wrote: >>> >>>> On Nov 15, 2015, at 9:54 AM, Itamar Turner-Trauring >>>>

Re: [Twisted-Python] Multiple reactors, connecting to self, or other solution?

2015-11-19 Thread Oon-Ee Ng
On Wed, Nov 18, 2015 at 4:55 PM, Glyph Lefkowitz wrote: > >> On Nov 15, 2015, at 9:54 AM, Itamar Turner-Trauring >> wrote: >> >> On 11/15/2015 10:19 AM, Oon-Ee Ng wrote: >>> Based on my reading/searching, multiple reactors in the same process >>> (

Re: [Twisted-Python] HTTP/2 and Twisted

2015-11-15 Thread Oon-Ee Ng
On Mon, Nov 16, 2015 at 1:56 AM, Itamar Turner-Trauring wrote: > On 11/13/2015 07:45 PM, Tristan Seligmann wrote: >> >> >> 1) The Twisted project has already experimentally demonstrated the >> imprudence of an approach that massively breaks backwards compatibility with >> old APIs (even if it does

Re: [Twisted-Python] Multiple reactors, connecting to self, or other solution?

2015-11-15 Thread Oon-Ee Ng
On Mon, Nov 16, 2015 at 1:54 AM, Itamar Turner-Trauring wrote: > On 11/15/2015 10:19 AM, Oon-Ee Ng wrote: >> >> I'm also unable to find any information about connecting to self (for >> example, to send messages from one reactor to itself). >> >> > > You

[Twisted-Python] Multiple reactors, connecting to self, or other solution?

2015-11-15 Thread Oon-Ee Ng
Based on my reading/searching, multiple reactors in the same process (even in multiple threads) is pretty much a no-go because twisted.internet.reactor is a global singleton. I'm also unable to find any information about connecting to self (for example, to send messages from one reactor to itself)

Re: [Twisted-Python] AMP with a long-lived connection - results and deferred?

2015-10-29 Thread Oon-Ee Ng
And lo and behold it seems to work now even with Kivy. Strange. For posterity, here's the simple client code I was using for a minimal example. I'll expand upwards from here and see how far I can get. #install_twisted_rector must be called before importing the reactor from kivy.support import inst

Re: [Twisted-Python] AMP with a long-lived connection - results and deferred?

2015-10-29 Thread Oon-Ee Ng
9, simpleSum) deferLater(reactor, 12, simpleSum) deferLater(reactor, 15, simpleSum) deferLater(reactor, 18, simpleSum).addCallback(lambda _: reactor.stop()) reactor.run() On Thu, Oct 29, 2015 at 3:37 PM, Oon-Ee Ng wrote: > Thanks David, but when I do something along the lines o

Re: [Twisted-Python] AMP with a long-lived connection - results and deferred?

2015-10-29 Thread Oon-Ee Ng
the most basic thing, modifying the doMath() example, and mycall only triggers when the reactor stops (even if I run doMath multiple times with delays). On Thu, Oct 29, 2015 at 1:15 PM, David Ripton wrote: > On 10/28/2015 02:24 AM, Oon-Ee Ng wrote: >> Working off the example ampserver.py a

Re: [Twisted-Python] AMP with a long-lived connection - results and deferred?

2015-10-27 Thread Oon-Ee Ng
but it doesn't seem to be doing the sort of bidirectional messaging AMP should be doing. In summary:- how do I see the response from client side without making a new connection every time I have something to send (as done in the ampclient.py example)? On Wed, Oct 28, 2015 at 2:24 PM, Oon

[Twisted-Python] AMP with a long-lived connection - results and deferred?

2015-10-27 Thread Oon-Ee Ng
Working off the example ampserver.py and ampclient.py examples, I wanted to build a client which maintains a single connection while allowing the passing of messages back and forth. However I'm stuck at one of the most basic steps, getting back the result (without 'completing' the connection). The