Re: How to use asyncore with SSL?

2018-01-22 Thread breamoreboy
to use it in the normal way via asyncore. > > Of course that fails the first time an ssl-wrapped-socket's send or > recv method raises SSLWantReadError or SSLWantWriteError. Those > exceptions aren't handled and it crashes. > > That makes the SSL support pretty much usel

Re: How to use asyncore with SSL?

2018-01-21 Thread Marko Rauhamaa
Grant Edwards : > On 2018-01-20, Marko Rauhamaa wrote: >> Also, a subsidiary thread is not necessary. Everything can be done >> within an async framework (in C anyway). > > Of course it can. But (ISTM) either the async framework has to be > SSL-aware, or the sockets have to be wrapped and "proxie

Re: How to use asyncore with SSL?

2018-01-20 Thread Grant Edwards
On 2018-01-20, Marko Rauhamaa wrote: > Grant Edwards : [...] >> I won't argue with that. I think that non-blocking ssl-wrapped >> sockets _should_ have the same select/poll/send/recv API/semantics >> that normal sockets do. I thought about writing my own >> wrapped-ssl-socket class that does tha

Re: How to use asyncore with SSL?

2018-01-20 Thread Marko Rauhamaa
Grant Edwards : > On 2018-01-20, Marko Rauhamaa wrote: >> OpenSSL isn't the easiest beast to deal with, but I have been able to >> abstract it (in C) so it behaves very close to TCP. The one blemish >> is in the fact that the TLS protocol does not support a half-duplex >> connection. Shame. >> >>

Re: How to use asyncore with SSL?

2018-01-20 Thread Grant Edwards
On 2018-01-20, Marko Rauhamaa wrote: > Grant Edwards : > >> Asyncore seems to be based on fundamental assumptions that aren't true >> for non-blocking ssl sockets. > > Pot calling kettle black. > > OpenSSL isn't the easiest beast to deal with, but I have

Re: How to use asyncore with SSL?

2018-01-20 Thread Marko Rauhamaa
Grant Edwards : > Asyncore seems to be based on fundamental assumptions that aren't true > for non-blocking ssl sockets. Pot calling kettle black. OpenSSL isn't the easiest beast to deal with, but I have been able to abstract it (in C) so it behaves very close to TCP. The one b

Re: How to use asyncore with SSL?

2018-01-20 Thread Grant Edwards
On 2018-01-18, Grant Edwards wrote: [regarding secure-smtpd -- a module based on smtpd and asyncore] > That makes the SSL support pretty much useless. > > I'm trying to fix that, but I can't find any information or > documentation about using asyncore with SSL. Asyncor

Re: How to use asyncore with SSL?

2018-01-19 Thread Grant Edwards
27;t find any information or >> documentation about using asyncore with SSL. > > I'm all in for asynchronous programming, but asyncore is a bit too naive > of an approach and shouldn't be used for anything serious. Python3, of > course, has the asyncio framework. I wo

Re: How to use asyncore with SSL?

2018-01-18 Thread Marko Rauhamaa
Grant Edwards : > I've been trying to use the secure smtpd module from > https://github.com/bcoe/secure-smtpd, but the SSL support seems to be > fundamentally broken. That module simply wraps a socket and then > expects to use it in the normal way via asyncore. > > Of cour

How to use asyncore with SSL?

2018-01-18 Thread Grant Edwards
I've been trying to use the secure smtpd module from https://github.com/bcoe/secure-smtpd, but the SSL support seems to be fundamentally broken. That module simply wraps a socket and then expects to use it in the normal way via asyncore. Of course that fails the first time an ssl-wr

Re: Java NIO server and Python asyncore client

2013-02-15 Thread Petri Heinilä
On Tuesday, February 5, 2013 10:09:28 AM UTC+2, foobar...@gmail.com wrote: > Can someone help answer this? > > http://stackoverflow.com/questions/14698020/java-nio-server-and-python-asyncore-client > > > > Blocking python client works, asyncore doesn't work. >

Re: Java NIO server and Python asyncore client

2013-02-05 Thread dieter
foobarome...@gmail.com writes: > Can someone help answer this? > http://stackoverflow.com/questions/14698020/java-nio-server-and-python-asyncore-client > > Blocking python client works, asyncore doesn't work. I fear you must tell us which Python version you are us

Java NIO server and Python asyncore client

2013-02-05 Thread foobarometer
Can someone help answer this? http://stackoverflow.com/questions/14698020/java-nio-server-and-python-asyncore-client Blocking python client works, asyncore doesn't work. Server.java: import java.net.InetAddress; import java.net.InetSocketAddress; import java.nio.channels.SelectionKey; i

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 >> >>  

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__': > >    

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: >

asyncore loop and cmdloop problem

2010-05-25 Thread kak...@gmail.com
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.exit(0) address = ('localhost&#

Re: asyncore based port splitter code questions

2010-01-08 Thread George Trojan
e the program exits immediately with a message: terminating - uncaught exception: [Errno 98] Address already in use As a final note I would recommend to take a look at pyftpdlib code which uses asyncore/asynchat as part of its core: http://code.google.com/p/pyftpdlib It can be of some help to figure

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.sl

asyncore based port splitter code questions

2010-01-04 Thread George Trojan
The following code is a attempt at port splitter: I want to forward data coming on tcp connection to several host/port addresses. It sort of works, but I am not happy with it. asyncore based code is supposed to be simple, but I need while loops and a lot of try/except clauses. Also, I had to

Re: Questions about asyncore

2008-08-05 Thread Frank Millman
On Aug 5, 6:18 pm, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Giampaolo already offered up some information, but I will offer these > two little tidbits: > In your first client, your handle_read doesn't handle the case where > you have received multiple packets at one time. That is, imagine tha

Re: Questions about asyncore

2008-08-05 Thread Josiah Carlson
On Jul 29, 4:09 am, Frank Millman <[EMAIL PROTECTED]> wrote: > Hi all > > I have been using my own home-brewed client/server technique for a > while, using socket and select. It seems to work ok. The server can > handle multiple clients. It does this by creating a new thread for > each connection.

Re: Questions about asyncore

2008-07-31 Thread Frank Millman
writing a test suite in which a > client checks responses sent by server I *would not* recommend using > asyncore. > The common way to do that is starting the server into setUp() method > and shut it down in tearDown(). > Every test consists in a client which uses the socket module to >

Re: Questions about asyncore

2008-07-31 Thread Giampaolo Rodola'
appreciated. > > > > > I pretty much have the same overview I had before. > > As far as I can tell the only reason you want to use a thread is when > > you have to do something which requires a consistent amount of time to > > complete so that the asyncore loop get

Re: Questions about asyncore

2008-07-30 Thread Frank Millman
as I can tell the only reason you want to use a thread is when > you have to do something which requires a consistent amount of time to > complete so that the asyncore loop gets blocked. > The question is: is there anything like that in your code? > If the answer is no then you don'

Re: Questions about asyncore

2008-07-30 Thread Giampaolo Rodola'
; fully understand why I would want to use them yet - I will have to go > over them a few more times. However, my handle_write() method seems to > be working ok and is not complicated, so I will stick with that for > now. I don't know whether you need to use them. I've just in

Re: Questions about asyncore

2008-07-30 Thread Frank Millman
gs to the new Branch. [1] Amongst other things, the server returns the id of the record [2] The update request uses the record id to identify which record to update These are just examples of the tests I might want to throw at the server. With my multi-threaded approach, the asyncore loop runs

Re: Questions about asyncore

2008-07-29 Thread Giampaolo Rodola'
On 29 Lug, 13:09, Frank Millman <[EMAIL PROTECTED]> wrote: > Firstly, having got asyncore working, I had a look at asynchat. As far > as I can see I get very little benefit from using it. I have already > set up a 'messaging' protocol between server and client, where al

Questions about asyncore

2008-07-29 Thread Frank Millman
changes, so I thought I would look at asyncore. I modified my program to use asyncore without much trouble, and it feels nicer. It uses async I/O instead of threading, and it relieves me of having to run my own select loop. I have two questions. They both relate to whether I am using the module as

Asynchronous urllib (urllib+asyncore)?

2008-02-26 Thread Jonathan Gardner
But I need this to exist in a non-asynchronous environment. I can't let Twisted take over everything. So, has someone done something like this? Is it something where I can bring the urllib and asyncore together? Or is it much more involved? -- http://mail.python.org/mailman/listinfo/python-list

Re: Using a signal to terminate a programm running with an asyncore loop

2008-02-19 Thread [EMAIL PROTECTED]
On Feb 8, 4:03 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > When signal is caught handle_shutdown_signal is called. At that point > SHUTDOWN_PERFORMED will ALWAYS be False. Normally all you do in this function > is to set SHUTDOWN_PERFORMED to True and have a test somewhere in your main > program

Re: Using a signal to terminate a programm running with an asyncore loop

2008-02-08 Thread [EMAIL PROTECTED]
On Feb 8, 4:03 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > When signal is caught handle_shutdown_signal is called.  At that point > SHUTDOWN_PERFORMED will ALWAYS be False.  Normally all you do in this function > is to set SHUTDOWN_PERFORMED to True and have a test somewhere in your main > program

Re: Using a signal to terminate a programm running with an asyncore loop

2008-02-08 Thread Larry Bates
[EMAIL PROTECTED] wrote: > On Feb 8, 7:04 am, Larry Bates <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> I'm developing a program that runs using an asyncore loop. Right now >>> I can adequately terminate it using Control-C, but as things get >

Re: Using a signal to terminate a programm running with an asyncore loop

2008-02-08 Thread [EMAIL PROTECTED]
On Feb 8, 7:04 am, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I'm developing a program that runs using an asyncore loop. Right now > > I can adequately terminate it using Control-C, but as things get > > refined I need a better way to

Re: Using a signal to terminate a programm running with an asyncore loop

2008-02-08 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I'm developing a program that runs using an asyncore loop. Right now > I can adequately terminate it using Control-C, but as things get > refined I need a better way to stop it. I've developed another > program that executes it as a child proce

Using a signal to terminate a programm running with an asyncore loop

2008-02-07 Thread [EMAIL PROTECTED]
I'm developing a program that runs using an asyncore loop. Right now I can adequately terminate it using Control-C, but as things get refined I need a better way to stop it. I've developed another program that executes it as a child process using popen2.Popen4(). I was attempting to u

Simple server using asyncore/asynchat

2008-01-01 Thread Rick
t and then immediately closes the connection with the client, but DOES print that the client was connected. Anyone know why? Here's my code: # conn.py import socket import asyncore import asynchat import string host = 'localhost' #socket.gethostname () port = 8017 buf

[search for reviewers] asyncore delayed calls feature

2007-12-18 Thread Giampaolo Rodola'
Hi, I post this message here in the hope someone using asyncore could review this. Since the thing I miss mostly in asyncore is a system for calling a function after a certain amount of time, I spent the last 3 days trying to implement this with the hopes that this could be included in asyncore in

speed versus threading or asyncore

2007-12-14 Thread scripteaze
I need some examples on using asycore for a client app im creating. I need to be able to connect to my server 10 times and i dont want any lag nor my cpu to be taxed. The examples ive found are for the server and i dont know how to implement asyncore on the client. -- http://mail.python.org

Re: Adding idle timeout capabilities to asyncore

2007-10-25 Thread Jean-Paul Calderone
7;m not sure that >your testing examples were ultimately germane to the conversation (how >would one handle timeouts in asyncore). Or maybe it's just late and >I've had a long day :/ . That's okay. I wasn't trying to be germane to the asyncore timeout handling convers

Re: Adding idle timeout capabilities to asyncore

2007-10-24 Thread Paul Rubin
Giampaolo Rodola' <[EMAIL PROTECTED]> writes: > def readable(self): > if time.time() >= self.timeout: > self.send("Timeout") > self.close() > return 1 Don't do it this way. Put all the timeouts into a priority queue (see the heapq module) so you only need to check the one

Re: Adding idle timeout capabilities to asyncore

2007-10-24 Thread Josiah Carlson
[0.68104482574668168, 0.64085672667252425, 0.6558844364245715] So to answer your question, even though I hadn't bothered to test it, my beliefs regarding time.time() being fast in relation to the particular operation he was expecting to perform, at least according to my own experience on the

Re: Adding idle timeout capabilities to asyncore

2007-10-24 Thread Giampaolo Rodola'
On 23 Ott, 17:34, Josiah Carlson <[EMAIL PROTECTED]> wrote: > On 22 Ott, 12:28, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > > > > > > Hi there. > > We're talking about an asyncore-based server. > > Just for the heck of it I'd

Re: Adding idle timeout capabilities to asyncore

2007-10-23 Thread Jean-Paul Calderone
On Tue, 23 Oct 2007 15:34:19 -, Josiah Carlson <[EMAIL PROTECTED]> wrote: > [snip] > >Calling time.time() is relatively inexpensive in comparison to pure >Python function calls, but indeed, it could be a bottleneck. Did you benchmark this on some system? There isn't really any "pure Python fu

Re: Adding idle timeout capabilities to asyncore

2007-10-23 Thread Josiah Carlson
On 22 Ott, 12:28, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > Hi there. > We're talking about an asyncore-based server. > Just for the heck of it I'd like to set a timeout which will > disconnects the clients if they're inactive (i.e., no command or d

Adding idle timeout capabilities to asyncore

2007-10-22 Thread Giampaolo Rodola'
Hi there. We're talking about an asyncore-based server. Just for the heck of it I'd like to set a timeout which will disconnects the clients if they're inactive (i.e., no command or data transfer in progress) for a long period of time. I was thinking about putting the timeou

Re: Integrating a GUI with an asyncore-based server

2007-10-16 Thread Michele Simionato
On Oct 16, 2:57 pm, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > Hi there. > Just for the heck of it I'd like to write a simple front-end for an > asyncore-based server I wrote by using Tkinter. > I wrote a simple graphical interface consisting of two buttons: "

Integrating a GUI with an asyncore-based server

2007-10-16 Thread Giampaolo Rodola'
Hi there. Just for the heck of it I'd like to write a simple front-end for an asyncore-based server I wrote by using Tkinter. I wrote a simple graphical interface consisting of two buttons: "Start server" and "Stop server". The first button should start the asyncore m

Integrating a GUI with an asyncore-based server

2007-10-16 Thread Giampaolo Rodola'
Hi there. Just for the heck of it I'd like to write a simple front-end for an asyncore-based server I wrote by using Tkinter. I wrote a simple graphical interface consisting of two buttons: "Start server" and "Stop server". The first button should start the asyncore m

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
eive on the data connection and not > > listening for commands on the control connection. So the user > > side is required to perform some "special action" that includes > > sending urgent data, which the server can then process specially. > > This problem arise

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

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 &g

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.rem

asyncore and OOB data

2007-07-11 Thread billiejoex
Hi there, 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.SOCK_STREAM) >>> s.connect(('127.0.0.1'

Re: Asyncore Help?

2007-05-17 Thread billiejoex
Not a big deal. asynchat / asyncore are pretty easy-to-learn frameworks. Under the hoods they are extremely simpler if compared to Twisted. You shouldn't have problems in learning how the things works in a couple of days. Try to take a look at: http://effbot.org/zone/asyncore-ftp-client.htm

Re: Asyncore Help?

2007-05-17 Thread billiejoex
Not a big deal. asynchat / asyncore are pretty easy-to-learn frameworks. Under the hoods they are extremely simpler if compared to Twisted. You shouldn't have problems in learning how the things works in a couple of days. Try to take a look at: http://effbot.org/zone/asyncore-ftp-client.htm

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

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? >

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

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

Asyncore Help?

2007-05-13 Thread Paul Kozik
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 pr

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

Re: asyncore DoS vulnerability

2007-02-03 Thread billie
ou > want to go over that. ? That's not a select() problem: that's an asyncore problem. I'm just saying that asyncore should handle this event in some other way than raising a not well defined "ValueError". I've discovered this problem accidentally by writing

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 t

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

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 ha

Re: asyncore DoS vulnerability

2007-02-02 Thread Chris Mellon
hink that such a thing should be handled by asyncore itself. > Handled by doing what, exactly? > > 512 is probably a fixed limit into XP, win2k3 or win2k server will > > accept more. > > Maybe It's possible to increase this value somewhere in the registry. > >

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 li

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 per

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)

asyncore DoS vulnerability

2007-02-01 Thread billie
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 and I discovered that asyncore (or better, select()) can manage only a limited number of file descriptors (aka simultaneous connec

Re: Asyncore select statement problem

2007-01-19 Thread JamesHoward
problem of threads closing devices at unknown times. The reason for this is that the select statement is called on a series of file descriptors that should not be changed. If the file descriptors become invalid, select throws and exception and the asyncore loop haults. The use_poll flag sets the

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.

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

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

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 <http://effbot.org/lib/asyncore.html#asyncore-example-basic-http-client> Asyncore worked fine on my application on Linux, but haven't tried that on MacOS. /Jean Brouwers

Asyncore select statement problem

2007-01-17 Thread JamesHoward
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 open Asyncore socket. Calling the socket.close() nor the socket.shutdown(2) calls se

Re: Help: asyncore/asynchat and terminator string

2007-01-17 Thread Gabriel Genellina
At Tuesday 16/1/2007 20:05, David Hirschfield wrote: I'm implementing a relatively simple inter-application communication system that uses asyncore/asynchat to send messages back and forth. The messages are prefixed by a length value and terminator string, to signal that a message is inc

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

Help: asyncore/asynchat and terminator string

2007-01-16 Thread David Hirschfield
I'm implementing a relatively simple inter-application communication system that uses asyncore/asynchat to send messages back and forth. The messages are prefixed by a length value and terminator string, to signal that a message is incoming, and an integer value specifying the size o

Re: sleep in asyncore

2007-01-11 Thread Fredrik Lundh
"billie" <[EMAIL PROTECTED]> wrote: > I'm writing an authentication server by using asyncore / asynchat > modules. > I'd like to implement a basic brute-force protection by "freezing / > sleeping" the current client session for a period of tim

sleep in asyncore

2007-01-11 Thread billie
Hi all. I'm writing an authentication server by using asyncore / asynchat modules. I'd like to implement a basic brute-force protection by "freezing / sleeping" the current client session for a period of time (e.g. 2 seconds) when the user sends a wrong password. Does someone k

Re: Add/Remove Channels in Asyncore?

2006-12-23 Thread Fredrik Lundh
Chris wrote: > I've implemented a real basic IRC client class in 100 lines using > asynchat (yes I know about Twisted). The problem I'm having is > arbitrarily starting and stopping multiple instances of this class > after I call loop(). > > The asyncore docs seem to

Add/Remove Channels in Asyncore?

2006-12-23 Thread Chris
I've implemented a real basic IRC client class in 100 lines using asynchat (yes I know about Twisted). The problem I'm having is arbitrarily starting and stopping multiple instances of this class after I call loop(). The asyncore docs seem to imply everything's fixed in stone

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

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

Asyncore Medusa Example

2006-11-29 Thread Graeme Matthew
Hi all 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 any help is appreciated regards graeme -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >