asyncore

Starting an INDIVIDUAL instance of a subclass from asynchat

So the situation I have is that I have loaded more than one class that I've made that subclasses from asynchat, but I only want one of them to run. Of course, this doesn't work out when I call asyncore.loop() as they all begin. Is there any way to make only one of them begin running? edit: I think it has something to do with the map par...

asyncore not running handle_read

I'm trying to just make a simple asyncore example where one socket is the sender and one is the receiver. For some reason, the handle_read() on the receiver is never called so I never get the 'test' data. Anyone know why? This is my first shot at asyncore, so it's probably something extremely simple. import asyncore, socket, pdb, random...

Python, Asyncore and forks.

Hey there. Just for starters, I used Twisted and SocketServer with both ForkMixIn, ThreadMixIn and tried the "thread-pool" recepies. However, I wanted to make something particular work in Python. Alittle background. Previously I wrote in C a simple TCP deamon that would bind to a socket and listen on it, then pre-fork X many times and...

Reading socket buffer using asyncore

I'm new to Python (I have been programming in Java for multiple years now though), and I am working on a simple socket-based networking application (just for fun). The idea is that my code connects to a remote TCP end-point and then listens for any data being pushed from the server to the client, and perform some parsing on this. The da...

Asyncore not working properly with Tkinter GUI

At this point I'm still a noob when it comes to GUI and network programming so I'm hoping this will be a very simple fix. I've got a very basic understanding of the tkinter and asyncore modules having built a handful of programs in each of them, however I'm having trouble using both of them together in a program. I put together an entire...

Python asyncore vs plain old C

Hi, i'm stress testing 2 different projects: one is proxsmtpd - smtp proxy written in C And the other one, smtp_proxy.py, which i developed under 1 hour, with use of asyncore and smtpd python modules. I stressed both projects under heavy load, and found out that proxsmtpd is able to hold 400 smtp sessions / sec, while my python program,...

QObject (QPlainTextEdit) & Multithreading issues

Im currently trying to learn Networking with Python asyncore and pyqt4. I coded a small server, which basically listens on some port, and resends all messages it recieves to the sender. Since both qts QApplication.exec_() and asyncore.loop() are functions which never return i could not start them both in one thread, so i stared asyncor...

Python asyncore & dbus

Is it possible to integrate asyncore with dbus through the same main loop? Usually, DBus integration is done through glib main loop: is it possible to have either asyncore integrate this main loop or have dbus use asyncore's ? ...

How do you build a Request-Response service using Asyncore in Python?

I have a 3rd-party protocol module (SNMP) that is built on top of asyncore. The asyncore interface is used to process response messages. What is the proper technique to design a client that generate the request-side of the protocol, while the asyncore main loop is running. I can think of two options right now: Use the loop,timeout para...

Reading fixed amount of bytes from socket with python asyncore

Hi, I use asyncore to communicate with remote servers using "length:message"-type protocol. Can someone recommend me a way to read exact amount of bytes from socket? I was trying to use handle_read to fill internal buffer and call my function every time, checking for size of buffer, but it looked too ugly(Check if buffer is long enough...

Python asyncore with very low timeout

I have written a program that communicates with many servers at once using the asyncore module. For the most part I am just responding to data received from the servers, but occasionally I need to send some data "out-of-sync". With the default timeout of 30 seconds there is an obvious delay before the packet gets sent, so I have lowered ...