Re: asyncore loop and cmdloop problem

2010-05-26 Thread kak...@gmail.com
On May 26, 2:03 am, exar...@twistedmatrix.com wrote: > On 04:31 pm, kak...@gmail.com wrote: > > > > >On May 25, 5:47 pm, "kak...@gmail.com" wrote: > >>On May 25, 5:23 pm, Michele Simionato > >>wrote: > > >> > On May 25, 2:56 pm, "kak...@gmail.com" wrote: > > >> > > Could you please provide me wi

Re: asyncore loop and cmdloop problem

2010-05-25 Thread exarkun
On 04:31 pm, kak...@gmail.com wrote: On May 25, 5:47�pm, "kak...@gmail.com" wrote: On May 25, 5:23�pm, Michele Simionato wrote: > On May 25, 2:56�pm, "kak...@gmail.com" wrote: > > Could you please provide me with a simple example how to do this with > > threads. > > I don't know where to

Re: asyncore loop and cmdloop problem

2010-05-25 Thread kak...@gmail.com
On May 25, 5:47 pm, "kak...@gmail.com" wrote: > On May 25, 5:23 pm, Michele Simionato > wrote: > > > On May 25, 2:56 pm, "kak...@gmail.com" wrote: > > > > Could you please provide me with a simple example how to do this with > > > threads. > > > I don't know where to put the cmdloop(). > > > Ple

Re: asyncore loop and cmdloop problem

2010-05-25 Thread kak...@gmail.com
On May 25, 5:23 pm, Michele Simionato wrote: > On May 25, 2:56 pm, "kak...@gmail.com" wrote: > > > Could you please provide me with a simple example how to do this with > > threads. > > I don't know where to put the cmdloop(). > > Please help, i' m so confused! > > Thank you > > What are you tryi

Re: asyncore loop and cmdloop problem

2010-05-25 Thread Michele Simionato
On May 25, 2:56 pm, "kak...@gmail.com" wrote: > Could you please provide me with a simple example how to do this with > threads. > I don't know where to put the cmdloop(). > Please help, i' m so confused! > Thank you What are you trying to do? Do you really need to use the standard library? Likel

Re: asyncore loop and cmdloop problem

2010-05-25 Thread kak...@gmail.com
On May 25, 6:48 am, Giampaolo Rodolà wrote: > 2010/5/25 Michele Simionato : > > > On May 25, 12:03 pm, Giampaolo Rodolà wrote: > >> Too bad cmdloop() doesn't provide an argument to return immediately. > >> Why don't you submit this patch on the bug tracker? > > >> --- > >> Giampaolohttp://code.g

Re: asyncore loop and cmdloop problem

2010-05-25 Thread Giampaolo Rodolà
2010/5/25 Michele Simionato : > On May 25, 12:03 pm, Giampaolo Rodolà wrote: >> Too bad cmdloop() doesn't provide an argument to return immediately. >> Why don't you submit this patch on the bug tracker? >> >> --- >> Giampaolohttp://code.google.com/p/pyftpdlibhttp://code.google.com/p/psutil > > B

Re: asyncore loop and cmdloop problem

2010-05-25 Thread Michele Simionato
On May 25, 12:03 pm, Giampaolo Rodolà wrote: > Too bad cmdloop() doesn't provide an argument to return immediately. > Why don't you submit this patch on the bug tracker? > > --- Giampaolohttp://code.google.com/p/pyftpdlibhttp://code.google.com/p/psutil Because it is not a bug, cmd was designed to

Re: asyncore loop and cmdloop problem

2010-05-25 Thread Giampaolo Rodolà
2010/5/25 Michele Simionato : > On May 25, 10:42 am, "kak...@gmail.com" wrote: >> Hi to all, >> i'm creating a command line application using asyncore and cmd. At >> >> if __name__ == '__main__': >>     import socket >> >>     args = sys.argv[1:] >>     if not args: >>         print "Usage: %s que

Re: asyncore loop and cmdloop problem

2010-05-25 Thread kak...@gmail.com
On May 25, 4:55 am, Michele Simionato wrote: > On May 25, 10:42 am, "kak...@gmail.com" wrote: > > > > > Hi to all, > > i'm creating a command line application using asyncore and cmd. At > > > if __name__ == '__main__': > >     import socket > > >     args = sys.argv[1:] > >     if not args: > >  

Re: asyncore loop and cmdloop problem

2010-05-25 Thread Michele Simionato
On May 25, 10:42 am, "kak...@gmail.com" wrote: > Hi to all, > i'm creating a command line application using asyncore and cmd. At > > if __name__ == '__main__': >     import socket > >     args = sys.argv[1:] >     if not args: >         print "Usage: %s querystring" % sys.argv[0] >         sys.exi

Re: asyncore based port splitter code questions

2010-01-08 Thread George Trojan
Thanks for your help. Some comments below. George Giampaolo Rodola' wrote: On 4 Gen, 18:58, George Trojan wrote: Secondly, to temporarily "sleep" your connections *don't* remove anything from your map. The correct way of doing things here is to override readable() and writable() methods and

Re: asyncore based port splitter code questions

2010-01-08 Thread Giampaolo Rodola'
On 4 Gen, 18:58, George Trojan wrote: > asyncore based code is supposed to be simple, > but I need while loops and a lot of try/except clauses. First of all: you DON'T have to use while loops or anything which is blocking where by "blocking" I mean anything like time.sleep(). asyncore, just like

Re: asyncore and OOB data

2007-07-12 Thread Douglas Wells
In article <[EMAIL PROTECTED]>, billiejoex <[EMAIL PROTECTED]> writes: > Douglas Wells wrote: > > > Second, when I look at the FTP specification, I don't find the > > concept of OOB anywhere. So, it's not clear what OOB data would > > mean in terms of the defined FTP commands in any case. > > S

Re: asyncore and OOB data

2007-07-12 Thread Douglas Wells
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> writes: > Douglas Wells wrote: > > > > Third, the TCP protocol, which you have selected via the SOCK_STREAM > > option doesn't support OOB at all, so there's no way that you can > > even send OOB data in the manner that you are expec

Re: asyncore and OOB data

2007-07-11 Thread billiejoex
Douglas Wells wrote: > Second, when I look at the FTP specification, I don't find the > concept of OOB anywhere. So, it's not clear what OOB data would > mean in terms of the defined FTP commands in any case. Steve Holde wrote: > You are correct, however, in stating that the FTP > protocol does

Re: asyncore and OOB data

2007-07-11 Thread Steve Holden
Douglas Wells wrote: > In article <[EMAIL PROTECTED]>, > billiejoex <[EMAIL PROTECTED]> writes: >> In an asyncore based FTP server I wrote I should be able to receive >> OOB data from clients. >> A client sending such kind of data should act like this: >> > import socket > s = socket.socke

Re: asyncore and OOB data

2007-07-11 Thread Douglas Wells
In article <[EMAIL PROTECTED]>, billiejoex <[EMAIL PROTECTED]> writes: > In an asyncore based FTP server I wrote I should be able to receive > OOB data from clients. > A client sending such kind of data should act like this: > > >>> import socket > >>> s = socket.socket(socket.AF_INET, socket.SOC

Re: asyncore and OOB data

2007-07-11 Thread billiejoex
If it could be useful I attach the complete server application I used for doing tests: < code > import asyncore, asynchat, socket, os class Handler(asynchat.async_chat): def __init__(self, sock_obj): asynchat.async_chat.__init__(self, conn=sock_obj) self.remote_ip, self.remo

Re: Asyncore Help?

2007-05-17 Thread billiejoex
On 14 Mag, 06:51, "Paul Kozik" <[EMAIL PROTECTED]> wrote: > I have trouble finding a solid example for what I need. Python.org and > other sites provide simple examples, but they appear more intended for > servers that simply send one peice of data to the client. Not a big deal. asynchat / asyncor

Re: Asyncore Help?

2007-05-17 Thread billiejoex
On 14 Mag, 06:51, "Paul Kozik" <[EMAIL PROTECTED]> wrote: > I have trouble finding a solid example for what I need. Python.org and > other sites provide simple examples, but they appear more intended for > servers that simply send one peice of data to the client. Not a big deal. asynchat / asyncor

Re: Asyncore Help?

2007-05-16 Thread Josiah Carlson
Paul Kozik wrote: > I am working on the networking code for a small Multiplayer RPG I'm > working on. I currently have some basic code using threads, but it > seems like asyncore would be far better suited for my needs. However, > I have trouble finding a solid example for what I need. Python.org a

Re: Asyncore Help?

2007-05-14 Thread Bjoern Schliessmann
Nick Craig-Wood wrote: > http://twistedmatrix.com/trac/ > > The learning curve of twisted is rather brutal, NACK, the tutorial is -- IMHO -- rather easy if you are used to writing Python code and doing asynchronous programming.

Re: Asyncore Help?

2007-05-14 Thread Jarek Zgoda
Daniel Nogradi napisał(a): > The twisted project might also be a good place for anything related to > python and networking: http://twistedmatrix.com/trac/ Twisted eats babies for breakfast, although it also kills all known germs(TM). ;) -- Jarek Zgoda "We read Knuth so you don't have to." --

Re: Asyncore Help?

2007-05-14 Thread Michael Bentley
On May 14, 2007, at 4:30 AM, Nick Craig-Wood wrote: > The learning curve of twisted is rather brutal :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Asyncore Help?

2007-05-14 Thread Nick Craig-Wood
Erik Max Francis <[EMAIL PROTECTED]> wrote: > Paul Kozik wrote: > > > While basic socket work was rather easy to deal with, this has proved > > significantly more difficult. Are there any good free sources for > > information on Asyncore, and dealing with TCP? > > You haven't said specifically

Re: Asyncore Help?

2007-05-14 Thread Daniel Nogradi
> I am working on the networking code for a small Multiplayer RPG I'm > working on. I currently have some basic code using threads, but it > seems like asyncore would be far better suited for my needs. However, > I have trouble finding a solid example for what I need. Python.org and > other sites p

Re: Asyncore Help?

2007-05-13 Thread Erik Max Francis
Paul Kozik wrote: > While basic socket work was rather easy to deal with, this has proved > significantly more difficult. Are there any good free sources for > information on Asyncore, and dealing with TCP? You haven't said specifically what you're having a problem with. The more general name f

Re: asyncore DoS vulnerability

2007-02-03 Thread aspineux
On 2 fév, 16:32, "billie" <[EMAIL PROTECTED]> wrote: > >> Why does this exception isn't handled inside asyncore.py? > > To do what ? To raise a custom asyncore error ? > > asyncore aims to be a framework, right? > I think that when select() limit is reached asyncore should just drop > other connect

Re: asyncore DoS vulnerability

2007-02-03 Thread billie
On 2 Feb, 17:09, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > Thats like asking why you should have to move your fingers to type or > why you should have to eat food in order to not starve. Windows is > placing a limit of 512 descriptors per process. Call Microsoft if you > want to go over that. ?

Re: asyncore DoS vulnerability

2007-02-02 Thread paul
Jean-Paul Calderone schrieb: > It could ask the application. On the other hand, maybe asyncore remains in > a perfectly consistent state even after it raises this exception, and it is > already "asking" by letting this exception propagate up: if the application > is free to start the loop again af

Re: asyncore DoS vulnerability

2007-02-02 Thread Jean-Paul Calderone
On Fri, 2 Feb 2007 10:39:57 -0600, [EMAIL PROTECTED] wrote: > >billie> asyncore aims to be a framework, right? I think that when >billie> select() limit is reached asyncore should just drop other >billie> connections. That's all. > >You're asking asyncore to make a policy decision on b

Re: asyncore DoS vulnerability

2007-02-02 Thread skip
billie> asyncore aims to be a framework, right? I think that when billie> select() limit is reached asyncore should just drop other billie> connections. That's all. You're asking asyncore to make a policy decision on behalf the controlling application. It has no idea what that appli

Re: asyncore DoS vulnerability

2007-02-02 Thread Chris Mellon
On 2 Feb 2007 07:32:14 -0800, billie <[EMAIL PROTECTED]> wrote: > > This is not a CRASH, It looks an exception with a "Traceback", this is > > the normal way python report problems, nothing wrong with that. > > You can handle it with a try: except: > > I think that such a thing should be handled by

Re: asyncore DoS vulnerability

2007-02-02 Thread billie
> This is not a CRASH, It looks an exception with a "Traceback", this is > the normal way python report problems, nothing wrong with that. > You can handle it with a try: except: I think that such a thing should be handled by asyncore itself. > 512 is probably a fixed limit into XP, win2k3 or win

Re: asyncore DoS vulnerability

2007-02-02 Thread aspineux
Did you take a look for "too many file descriptors in select()" on google. On 1 fév, 20:18, "billie" <[EMAIL PROTECTED]> wrote: > Hi all. I've just terminated a server application using asyncore / > asynchat frameworks. > I wrote a test script that performs a lot of connections to the server > app

Re: asyncore DoS vulnerability

2007-02-02 Thread William Heymann
On Thursday 01 February 2007, billie wrote: > Here's the traceback: > > Traceback (most recent call last): > File "C:\Documents and Settings\root\Desktop\test.py", line 31, in ? > asyncore.loop(timeout=1) > File "C:\Python24\lib\asyncore.py", line 192, in loop > poll_fun(timeout, map)

Re: Asyncore select statement problem

2007-01-19 Thread JamesHoward
Again, thank you for your help. With digging through the Asyncore.py source, I was able to find the poll2 function which is called when the function asyncore.loop(use_poll = True) is enabled. This function does not use a select call, but a poll call to do its looping. It works well for the probl

Re: Asyncore select statement problem

2007-01-19 Thread Gabriel Genellina
At Friday 19/1/2007 14:42, JamesHoward wrote: Thank you for the responses. I have learned considerably more about how Asyncore works because of it. The problem that I see is that Asyncore's poll function does not seem to be thread safe. From what I can tell, I am calling dispatcher.close() pr

Re: Asyncore select statement problem

2007-01-19 Thread JamesHoward
Thank you for the responses. I have learned considerably more about how Asyncore works because of it. The problem that I see is that Asyncore's poll function does not seem to be thread safe. From what I can tell, I am calling dispatcher.close() properly and the dispatchers are removed from async

Re: Asyncore select statement problem

2007-01-18 Thread Gabriel Genellina
"JamesHoward" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] >I have a problem with python's asyncore module throwing a bad file > descriptor error. The code might be difficult to copy here, but the > problem is essentially: > > The server wants to sever the connection of an o

Re: Asyncore select statement problem

2007-01-17 Thread MrJean1
Try using another ascyncore example and see if that works for you. Maybe, first one without threading, like Asyncore worked fine on my application on Linux, but haven't tried that on MacOS. /Jean Brouwers JamesHoward wr

Re: asyncore/asynchat and terminator string

2007-01-17 Thread Hendrik van Rooyen
"David Hirschfield" <[EMAIL PROTECTED]> wrote: 8< --- problems on syncing up in serial comms - I have seen people address this with success by using stuff like: "XXHEADERXX" as a "here starts the lesson" identifier, with no trouble, on a high volume newsfeed. If yo

Re: Asyncore Medusa Example

2006-11-29 Thread Fredrik Lundh
Graeme Matthew wrote: > does anyone know where you can find examples of how to write a native > python webserver, I have looked at medusa and asyncore but there are no > real examples and the doco is very light medusa *is* a web server based on asyncore, so you should be able to use it more or

Re: Asyncore Medusa Example

2006-11-29 Thread Gabriel Genellina
At Wednesday 29/11/2006 07:23, Graeme Matthew wrote: does anyone know where you can find examples of how to write a native python webserver, I have looked at medusa and asyncore but there are no real examples and the doco is very light The Python standard library already comes with a native HT

Re: asyncore/asynchat do not notify connection errors on Wintel?

2006-03-16 Thread Abdullah Yoldas
Normally when you make a nonblocking connect, socket gets EINPROGRESS, later the result of this request will appear after select returns.   I think asyncore/asynchat incorrectly interprets asychronous connects. Reading Steven's book, I did some modifications to asyncore.dispatcher and asynchat.asyn

Re: asyncore question

2005-11-23 Thread Fredrik Lundh
Stéphane Ninin wrote: > >>> from asyncore import dispatcher > >>> d=dispatcher() > >>> print d > None > >>> d > > >>> print type(d) > > >>> d.__class__ > > >>> d is None > False > >>> ^Z > > why > >>> print d > prints None ? it's a tricky one: the dispatcher class has a __repr__ method but no

Re: asyncore question

2005-11-23 Thread Steve Holden
Stéphane Ninin wrote: > Hello, > > Probably a stupid question... but still: > > from asyncore import dispatcher d=dispatcher() print d > > None > d > > > print type(d) > > > d.__class__ > > > d is None > > False > ^Z > > > why > print d >

Re: asyncore question

2005-11-23 Thread snoe
Not 100% sure why print d gives None but if you need to print something that represents the instance, use repr >>> d.__str__ >>> str(d) 'None' >>> repr(d) '' >>> print repr(d) Why isn't __str__ in dir? >>> dir(d) ['__doc__', '__getattr__', '__init__', '__module__', '__repr__', '_map', 'accept

Re: Asyncore Loop Question

2005-10-31 Thread Steve Holden
John W wrote: > On 10/31/05, Steve Holden <[EMAIL PROTECTED]> wrote: > >>John W wrote: >> >>>Hello, >>> >>>I have a gui application where I am trying to use the asyncore module to >>>gather data from other computers. I am able to connect, but I am getting >>>constant handle_write_event method call

Re: Asyncore Loop Question

2005-10-31 Thread John W
Steve, Ar you saying that I should close the connection until I have data to write?  Or should I be using the readable and writable methods to turn it off? Thanks for your help, unfortunatly, I have struggled with the documentation and getting a clear understanding of everything.  This is my firs

Re: Asyncore Loop Question

2005-10-31 Thread Steve Holden
John W wrote: > Hello, > > I have a gui application where I am trying to use the asyncore module to > gather data from other computers. I am able to connect, but I am getting > constant handle_write_event method calls into my application. It is > obviously slowing down the gui processing significa

Re: Asyncore

2005-01-07 Thread Jp Calderone
On 7 Jan 2005 00:14:26 -0800, [EMAIL PROTECTED] wrote: >Is there any tutorial and docs with samples how to use asyncore module? See these threads: http://mail.python.org/pipermail/python-list/2004-March/214105.html http://mail.python.org/pipermail/python-dev/2004-November/049819.html

Re: Asyncore

2005-01-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: Is there any tutorial and docs with samples how to use asyncore module? Thanks Lad Well, here's a very simple web server from Chapter 7 of "Python Web Programming" which might help get you started. You can see a few more examples if you download the code from the book,