Questions tagged [twisted.client]

32 questions
4
votes
1 answer

Python Twisted Client Connection Lost

I have this twisted client, which connects with a twisted server having an index. I ran this client from command-line. It worked fine. Now I modified it to run in loop (see main()) so that I can keep querying. But the client runs only once. Next…
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
4
votes
1 answer

Python Twisted Client

I have this simple Twisted Client which connects to a Twisted server & queries an index. If you see fn. connectionMade() in class SpellClient, the query is hard-coded. Did that for testing purposes. How would one pass this query from outside to…
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
3
votes
1 answer

Make GET request and then print out the response body with Python (Twisted)

On Twisted's website, they have an example called "Receiving Responses" which shows you how to get the response headers and response code among other things, but not the response body (the actual HTML body returned by the request to the website). in…
3
votes
1 answer

Refactoring for a twisted tcp client from existing blocking code

I have a python program that currently uses a tcp/ip client module I wrote to receive data from a streaming server. The server outputs lines of data. My TCP client class is fairly primitive and I want to refactor to use a twisted…
RoyHB
  • 1,715
  • 1
  • 22
  • 38
2
votes
2 answers

Python Twisted Daemon

I have written a simple twisted server - from twisted.internet import reactor from twisted.internet import protocol from twisted.web import server, resource from twisted.internet import reactor class Index(resource.Resource): isLeaf = True …
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
2
votes
3 answers

Python, Twisted, Django, reactor.run() causing problem

I have a Django web application. I also have a spell server written using twisted running on the same machine having django (running on localhost:8090). The idea being when user does some action, request comes to Django which in turn connects to…
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
2
votes
1 answer

twisted Get response data at client

I followed this tutorial but I don't know how to get response data from server. class Service(Resource): def render_POST(self, request): return 'response message' I know that the response data will be displayed in the client def…
TomNg
  • 1,897
  • 2
  • 18
  • 25
2
votes
1 answer

Twisted - I need to periodically connect/disconnect a client connection

I have a twisted tcp client that I would like to periodically cause to connect, receive a stream of date for n seconds, then disconnect. After disconnecting n seconds would elapse before the process started over again. Below is a very abbreviated…
RoyHB
  • 1,715
  • 1
  • 22
  • 38
2
votes
2 answers

Twisted ReconnectingClientFactory - auto reconnect or explicitly call connector.connect()?

When using a Twisted ReconnectingClientFactory and the connection is lost do I need to call connector.connect() from within the clientConnectionLost method or does that happen automagically? The answer might seem obvious because it is, after all,…
RoyHB
  • 1,715
  • 1
  • 22
  • 38
2
votes
1 answer

Simple Twisted Echo Client

I'm trying to write a simple Echo client in Twisted that sends keyboard input to the server, and is terminated by the user entering 'q' on it's own. In short, I'm just trying to modify the simple echo client (and variants) found on this page.…
CadentOrange
  • 3,263
  • 1
  • 34
  • 52
1
vote
1 answer

How can I run a simple twisted client on top of asyncio?

I have the following client code that I borrowed from twisted's docs: https://docs.twistedmatrix.com/en/twisted-20.3.0/web/howto/client.html#the-agent And I am trying to run it with asyncio since I am building an asyncio project that requires…
1
vote
1 answer

Access socket options for twisted.web.client.Agent

How can i access underlying socket from twisted.web.client.Agent? I need to enable TCP_NODELAY on this socket.
Michael
  • 197
  • 1
  • 2
  • 10
1
vote
1 answer

Starting and stopping Twisted connections

I'm writing application that uses python Twisted API (namely WebSocketClientProtocol, WebSocketClientFactory, ReconnectiongClientFactory. I want to wrap client factory into reader with following interface class Reader: def start(self): …
1
vote
1 answer

Error trying to get uids of emails in large folders using IMAP and Twisted

I am writing an IMAP client using the last version of Twisted. I am having trouble using two different ways for getting email UIDs. First i have tried to use the search method this way : @inlineCallbacks def getEmailList(self): for f in…
MaxRic
  • 11
  • 2
1
vote
1 answer

Store image in server using Twisted

So far I have developed a server for a chat application using the Twisted framework and I am having a hard time trying to figure out how to implement storing a certain person's photo. My first idea was that I can store the image locally[is this the…
tudoricc
  • 709
  • 1
  • 12
  • 31
1
2 3