Re: Does module socketserver using epoll in python3?

2019-11-28 Thread lampahome
> > The source code is here: > https://github.com/python/cpython/blob/master/Lib/socketserver.py . You > should find all the technical details you are looking for in it. > > # poll/select have the advantage of not requiring any extra file > descriptor,# contrarily to epoll/kqueue (also, they requi

Re: Does module socketserver using epoll in python3?

2019-11-28 Thread Michael Torrie
On 11/28/19 8:46 PM, lampahome wrote: > As title, > > I want to use socketserver to replace my own server code to > maintain ealsier. > > But I don't found any info about tech. detail of socketserver, epoll is > important. > > Can anyone tell me? The source

Does module socketserver using epoll in python3?

2019-11-28 Thread lampahome
As title, I want to use socketserver to replace my own server code to maintain ealsier. But I don't found any info about tech. detail of socketserver, epoll is important. Can anyone tell me? -- https://mail.python.org/mailman/listinfo/python-list

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Chris Angelico
On Tue, Apr 4, 2017 at 12:34 AM, Paul Moore wrote: > On Monday, 3 April 2017 15:10:12 UTC+1, Chris Angelico wrote: >> You're getting HTTP/1.1 requests. Maybe you need to send a >> "Connection: close" header to tell the browser to leave you be? > > That sounds possible - I don't really know enoug

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Paul Moore
On Monday, 3 April 2017 15:10:12 UTC+1, Chris Angelico wrote: > You're getting HTTP/1.1 requests. Maybe you need to send a > "Connection: close" header to tell the browser to leave you be? That sounds possible - I don't really know enough about HTTP to even know that was a thing, so I'm not surp

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Chris Angelico
On Mon, Apr 3, 2017 at 11:56 PM, Paul Moore wrote: > On Monday, 3 April 2017 14:20:43 UTC+1, Paul Moore wrote: >> On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote: >> > It should service the request and return to the serve_forever() loop. >> > Do you see a line logged for each request, l

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Paul Moore
On Monday, 3 April 2017 14:20:43 UTC+1, Paul Moore wrote: > On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote: > > It should service the request and return to the serve_forever() loop. > > Do you see a line logged for each request, like "[IP] - - [date] "GET > > ..."? > > Yes, I see that a

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 1:20 PM, Paul Moore wrote: > On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote: >> It should service the request and return to the serve_forever() loop. >> Do you see a line logged for each request, like "[IP] - - [date] "GET >> ..."? > > Yes, I see that and the page

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Paul Moore
On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote: > It should service the request and return to the serve_forever() loop. > Do you see a line logged for each request, like "[IP] - - [date] "GET > ..."? Yes, I see that and the page is served. >py .\example.py Serving HTTP on port 8000... 12

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 12:34 PM, Paul Moore wrote: > On Monday, 3 April 2017 13:23:11 UTC+1, eryk sun wrote: >> It works for me when run from a command prompt in Windows 10. >> serve_forever() uses select() with a timeout of 0.5s, so it doesn't >> block the main thread. > > Odd. For me, it doesn

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread Paul Moore
On Monday, 3 April 2017 13:23:11 UTC+1, eryk sun wrote: > It works for me when run from a command prompt in Windows 10. > serve_forever() uses select() with a timeout of 0.5s, so it doesn't > block the main thread. Odd. For me, it doesn't work (Windows 7, but I can't see why that would affect it

Re: SocketServer and Ctrl-C on Windows

2017-04-03 Thread eryk sun
On Mon, Apr 3, 2017 at 9:08 AM, Paul Moore wrote: > I know I've seen this before, but for the life of me I can't find any > reference. > > If I write a simple web server using wsgiref, something like > > from wsgiref.simple_server import make_server, demo_app > > with make_server('', 800

SocketServer and Ctrl-C on Windows

2017-04-03 Thread Paul Moore
I know I've seen this before, but for the life of me I can't find any reference. If I write a simple web server using wsgiref, something like from wsgiref.simple_server import make_server, demo_app with make_server('', 8000, demo_app) as httpd: print("Serving HTTP on port 8000...

Re: socketserver question

2012-01-08 Thread Bryan
K Richard Pixley wrote: [...] > The doc says server.shutdown(), but if I call self.server.shutdown() > from within handler.handle(), I seem to get a deadlock, which is exactly > what I'd expect in a single threaded system with no way to "signal" the > server.server_forever() loop which is several f

socketserver question

2012-01-05 Thread K Richard Pixley
Once I've instantiated my server class, along with a handler class, called server.serve_forever(), handler.handle() has been called, I've done my work, and I'm ready to shut the whole thing down... How do I do that? The doc says server.shutdown(), but if I call self.server.shutdown() from wit

Re: sending more then 2 messages to SocketServer fasils

2011-11-01 Thread Roy Smith
In article <4eb00a7a$0$6560$9b4e6...@newsspool4.arcor-online.net>, MrSmile wrote: > Hi people! > I have asked myself why I am not capable sending 2 messages a time to a > Socketserver. Why is that?! There's a lot of confusing code here. It would help when asking these k

Re: sending more then 2 messages at a time to a SocketServer fails

2011-11-01 Thread Tamer Higazi
7;%s' % data) received[1] = sock.recv(1024) sock.close() print received Server: import SocketServer from ast import literal_eval class MySockX(SocketServer.BaseRequestHandler): def handle(self): data = self.request.recv(1024) data = literal_eval(data) data = &#

Re: sending more then 2 messages at a time to a SocketServer fails

2011-11-01 Thread MRAB
On 01/11/2011 15:07, MrSmile wrote: Hi people! I have asked myself why I am not capable sending 2 messages a time to a Socketserver. Why is that?! Here the Server: import SocketServer from ast import literal_eval class MKTest(object): DSX = [] MKTestInst = None def __init__

Re: sending more then 2 messages at a time to a SocketServer fails

2011-11-01 Thread Miki Tebeka
MKTest.getObj(data[0]) will return the same object on every call(with the same data that was initialized 1'st time). Any Daten parameter after the 1'st call is ignored. -- http://mail.python.org/mailman/listinfo/python-list

sending more then 2 messages at a time to a SocketServer fails

2011-11-01 Thread MrSmile
Hi people! I have asked myself why I am not capable sending 2 messages a time to a Socketserver. Why is that?! Here the Server: import SocketServer from ast import literal_eval class MKTest(object): DSX = [] MKTestInst = None def __init__(self,Daten): MKTest.DSX.append

sending more then 2 messages to SocketServer fasils

2011-11-01 Thread MrSmile
Hi people! I have asked myself why I am not capable sending 2 messages a time to a Socketserver. Why is that?! Here the Server: import SocketServer from ast import literal_eval class MKTest(object): DSX = [] MKTestInst = None def __init__(self,Daten): MKTest.DSX.append

Re: SocketServer expceion after upgrading to 2.7

2011-08-10 Thread Irmen de Jong
given) I get this error with a program, after upgrading to python 2.7. I'm using a program that is based on SocketServer and SimpleXMLRPCDispatcher. Any idea how to fix this? Strange, I expected at least one or two more stack frames in the traceback you posted (from within the socket

SocketServer expceion after upgrading to 2.7

2011-08-10 Thread Laszlo Nagy
I get this error with a program, after upgrading to python 2.7. I'm using a program that is based on SocketServer and SimpleXMLRPCDispatcher. Any idea how to fix this? Thanks, Laszlo -- http://mail.python.org/mailman/listinfo/python-list

Re: SocketServer problem: client hangs trying to reconnect after server restart

2011-02-28 Thread Massi
On 28 Feb, 13:34, cmcp wrote: > In method StopServer() of class MyServer try calling  self.server_close() > after the self.shutdown() call.  I believe this will actually close the > server's socket and allow its reuse. It works! Thank you!! -- http://mail.python.org/mailman/listinfo/python-lis

Re: SocketServer problem: client hangs trying to reconnect after server restart

2011-02-28 Thread cmcp
In method StopServer() of class MyServer try calling self.server_close() after the self.shutdown() call. I believe this will actually close the server's socket and allow its reuse. -- http://mail.python.org/mailman/listinfo/python-list

SocketServer problem: client hangs trying to reconnect after server restart

2011-02-28 Thread Massi
Hi everyone! in my script (Python 2.6 on windows 7) I have to set up a SocketServer server and use it to handle external connections. During the execution It can happen that this server should be closed and restarted (for example with different port or host). The following piece of code simulates

Re: SocketServer: replace network by hard drive

2010-09-25 Thread Nobody
On Sat, 25 Sep 2010 14:45:29 +0200, Thomas Jollans wrote: >> The problem with using the loopback interface is that it's still >> "network access", which can run into all kinds of issues with security >> policies, firewalls, etc. > > What kind of crappy firewall blocks loopback traffic? Really? T

Re: SocketServer: replace network by hard drive

2010-09-25 Thread Thomas Jollans
On Saturday 25 September 2010, it occurred to Nobody to exclaim: > On Fri, 24 Sep 2010 19:28:45 +0200, Thomas Jollans wrote: > > If you're using UNIX, and you don't actually need the stream to be > > passed via the hard drive (why would you?), but for some reason want to > > use the file system, lo

Re: SocketServer: replace network by hard drive

2010-09-25 Thread Nobody
On Fri, 24 Sep 2010 19:28:45 +0200, Thomas Jollans wrote: > If you're using UNIX, and you don't actually need the stream to be > passed via the hard drive (why would you?), but for some reason want to > use the file system, look info UNIX/local sockets. But, really, I'm > guessing that local TCP s

Re: SocketServer: replace network by hard drive

2010-09-24 Thread John Nagle
On 9/24/2010 12:53 AM, antoine wrote: Hello, I would like to create a python server for which the requests are passed by files on the hard drive instead of a network. I am currently looking at the SocketServer python module, hoping for an easy modification. Is it doable at all? If yes, how

Re: SocketServer: replace network by hard drive

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to antoine to exclaim: > Hello, > > I would like to create a python server for which the requests are > passed by files on the hard drive instead of a network. > I am currently looking at the SocketServer python module, hoping for > an

SocketServer: replace network by hard drive

2010-09-24 Thread antoine
Hello, I would like to create a python server for which the requests are passed by files on the hard drive instead of a network. I am currently looking at the SocketServer python module, hoping for an easy modification. Is it doable at all? If yes, how should it be done? Thanks, Antoine

Re: SocketServer error: AttributeError: instance has no __call__ method

2010-02-10 Thread Gabriel Genellina
En Wed, 10 Feb 2010 17:13:58 -0300, Jordan Apgar escribió: I'm having some issues connecting to my Socket Server, I get this traceback on the sever side: Exception happened during processing of request from ('127.0.0.1', 56404) Traceback (most recent

SocketServer error: AttributeError: instance has no __call__ method

2010-02-10 Thread Jordan Apgar
dComs import * from Crypto.Hash import SHA256 from Crypto.Cipher import AES from Crypto import Random from Crypto.PublicKey import RSA import xmlrpclib as xmlrpc import os import SocketServer class Negotiator(SocketServer.BaseRequestHandler): CLIENT_KEY = 0 CSCIPHER = 1 SCCIPHER = 2 CSHAL

SocketServer

2009-10-12 Thread Boris Arloff
This may not be the correct list for this issue, if so I would appreciate if anyone could forward it to the correct list.   I had experienced a number of problems with standard library SocketServer when implementing a tcp forking server under python 2.6.  I fixed every issue including some

Re: Client/Server based on SocketServer and Windows

2009-08-10 Thread Dave Angel
Kiki wrote: Thank you Dennis I'm using 2 differents editor, which may be the cause of such a mess in the indentation. I must admitt that I lazily rely on those (not so bad indeed) editors. "If indentation whas bad they would have tell me" Too bad am i Won't post misindeted code anymore.

Re: Client/Server based on SocketServer and Windows

2009-08-09 Thread Kiki
Thank you Dennis I'm using 2 differents editor, which may be the cause of such a mess in the indentation. I must admitt that I lazily rely on those (not so bad indeed) editors. "If indentation whas bad they would have tell me" Too bad am i Won't post misindeted code anymore. -- http://mail.py

Client/Server based on SocketServer and Windows

2009-08-09 Thread Kiki
Hello list, I've written a small Client/server system. Basically, i'm expecting something like : The client sends every once and a while a small data chunk (not more than 50 bytes) the server receive it and print it. Here is the server request handler : class ThreadedTCPRequestHandlerFoo(SocketS

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-17 Thread Igor Katson
rote: I have problems in getting a SocketServer to shutdown. Shutdown implies closing the listening socket, doesn't it? No (perhaps it should, but that is another issue). There is a documentation bug; BaseServer.shutdown is documented as "Tells the serve_forever() loop to stop and

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-16 Thread Gabriel Genellina
roblems in getting a SocketServer to shutdown. Shutdown implies closing the listening socket, doesn't it? No (perhaps it should, but that is another issue). There is a documentation bug; BaseServer.shutdown is documented as "Tells the serve_forever() loop to stop and waits until it does.&q

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-16 Thread Igor Katson
Gabriel Genellina wrote: En Fri, 15 May 2009 09:04:05 -0300, Igor Katson escribió: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have problems in getting a SocketServer to shutdown. Do you want to do a s

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Igor Katson
Gabriel Genellina wrote: En Fri, 15 May 2009 09:04:05 -0300, Igor Katson escribió: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have problems in getting a SocketServer to shutdown. Do you want to do a s

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Gabriel Genellina
En Fri, 15 May 2009 09:04:05 -0300, Igor Katson escribió: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have problems in getting a SocketServer to shutdown. Do you want to do a shutdown or a close?

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Igor Katson
Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have problems in getting a SocketServer to shutdown. Do you want to do a shutdown or a close? I want the server close

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Lawrence D'Oliveiro
In message , Igor Katson wrote: > Lawrence D'Oliveiro wrote: > >> In message , Igor >> Katson wrote: >> >>> I have problems in getting a SocketServer to shutdown. >> >> Do you want to do a shutdown or a close? >> > I want the serv

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Igor Katson
Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have problems in getting a SocketServer to shutdown. Do you want to do a shutdown or a close? I want the server close the socket, and the program to continue after that (in this case, just to terminate). --

Re: KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Lawrence D'Oliveiro
In message , Igor Katson wrote: > I have problems in getting a SocketServer to shutdown. Do you want to do a shutdown or a close? -- http://mail.python.org/mailman/listinfo/python-list

KeyboardInterrupt catch does not shut down the socketserver

2009-05-15 Thread Igor Katson
I have problems in getting a SocketServer to shutdown. Why does this not actually stop the application? from SocketServer import UnixStreamServer, BaseRequestHandler server = UnixStreamServer('/tmp/ss.sock', BaseRequestHandler) try: server.serve_forever() except Keyboar

Re: Python SocketServer with IPv6

2009-04-30 Thread godshorse
On Apr 30, 1:02 pm, "Martin v. Löwis" wrote: > > I am working on a overlay network implementation with python. I need > > to use both IPv4 and IPv6 at each node. Python socketserver is being > > used for this task. can anybody pls suggest me how to input an IPv6 >

Re: Python SocketServer with IPv6

2009-04-29 Thread Martin v. Löwis
> I am working on a overlay network implementation with python. I need > to use both IPv4 and IPv6 at each node. Python socketserver is being > used for this task. can anybody pls suggest me how to input an IPv6 > address to the socketserver. I'm not quite sure I understand the

Python SocketServer with IPv6

2009-04-29 Thread godshorse
Hello, I am working on a overlay network implementation with python. I need to use both IPv4 and IPv6 at each node. Python socketserver is being used for this task. can anybody pls suggest me how to input an IPv6 address to the socketserver. Thanks in advance, -- http://mail.python.org/mailman

Re: Stopping SocketServer on Python 2.5

2009-03-20 Thread Aahz
In article <45bd$0$2191$c3e8...@news.astraweb.com>, David George wrote: > >Thanks to everybody for helping me with this matter, but eventually >i've had to settle for a simpler and probably far less elegant solution >due to time constraints. > >It seems that SocketServer.py in 2.6 doesn't d

Re: Stopping SocketServer on Python 2.5

2009-03-12 Thread David George
On 2009-03-12 08:03:06 +, "Mark Tolonen" said: "Falcolas" wrote in message news:1b6a95a4-5680-442e-8ad0-47aa9ea08...@w1g2000prk.googlegroups.com... On Mar 11, 1:11 pm, David George wrote: Again, problem here is the issue of being unable to kill the server while it's waiting on a reque

Re: Stopping SocketServer on Python 2.5

2009-03-12 Thread Mark Tolonen
"Falcolas" wrote in message news:1b6a95a4-5680-442e-8ad0-47aa9ea08...@w1g2000prk.googlegroups.com... On Mar 11, 1:11 pm, David George wrote: Again, problem here is the issue of being unable to kill the server while it's waiting on a request. In theory, i could force it to continue by sending

Re: Stopping SocketServer on Python 2.5

2009-03-11 Thread Falcolas
On Mar 11, 1:11 pm, David George wrote: > Again, problem here is the issue of being unable to kill the server > while it's waiting on a request. In theory, i could force it to > continue by sending some sort of junk data with the method i use to > stop the server, but that seems a bit hacky, don't

Re: Stopping SocketServer on Python 2.5

2009-03-11 Thread David George
ome code for a university project using Python. We've been working on an existing codebase, cleaning it up and removin g dead wood. We decided to make some changes to internal message handling by using a SocketServer, which worked great when we were using 2.6, as we could simply call

Re: Stopping SocketServer on Python 2.5

2009-03-11 Thread Falcolas
been developing some code for a university project using Python. > >> We've been working on an existing codebase, cleaning it up and removing > >> dead wood. > > >> We decided to make some changes to internal message handling by using a > >> SocketServer,

Re: Stopping SocketServer on Python 2.5

2009-03-11 Thread David George
e, cleaning it up and removing dead wood. We decided to make some changes to internal message handling by using a SocketServer, which worked great when we were using 2.6, as we could simply call its shutdown() method when we wanted to stop it from 'serving forever'. Unfortunately, we&

Re: Stopping SocketServer on Python 2.5

2009-03-11 Thread Falcolas
On Mar 10, 7:19 pm, David George wrote: > So, my question is, is there any way to stop a SocketServer that's been > told to server forever in python 2.5? serve_forever, in python 2.5, is simply coded as: while 1: self.handle_request() So, instead of calling serve_fo

Re: Stopping SocketServer on Python 2.5

2009-03-10 Thread Mark Tolonen
changes to internal message handling by using a SocketServer, which worked great when we were using 2.6, as we could simply call its shutdown() method when we wanted to stop it from 'serving forever'. Unfortunately, we've now needed to downgrade to python 2.5 to accomodate the

Stopping SocketServer on Python 2.5

2009-03-10 Thread David George
Hi guys, I've been developing some code for a university project using Python. We've been working on an existing codebase, cleaning it up and removing dead wood. We decided to make some changes to internal message handling by using a SocketServer, which worked great when we were

Re: where is handle_timeout in SocketServer

2009-02-11 Thread Daniel
On Feb 11, 4:01 pm, Daniel wrote: > I've just been reading the docs to help me with a SocketServer issue. > I found in the docs (http://docs.python.org/library/socketserver.html) > a reference to a member attribute timeout and a member function > handle_timeout() is made.  I am

where is handle_timeout in SocketServer

2009-02-11 Thread Daniel
I've just been reading the docs to help me with a SocketServer issue. I found in the docs (http://docs.python.org/library/socketserver.html) a reference to a member attribute timeout and a member function handle_timeout() is made. I am using python 2.5 and there's no indication that

Re: persistent TCP connection in python using socketserver

2009-02-03 Thread Jean-Paul Calderone
On Sat, 31 Jan 2009 09:31:52 -0800 (PST), markobrie...@gmail.com wrote: [snip] Cheers mate I had a look into twisted but was put off by the FAQ stating 1.0+ modules may or may not be stable, and only the 'core' is. I don't wanna be messing around with a potentially buggy server, so im gonna roll

Re: persistent TCP connection in python using socketserver

2009-02-01 Thread BlakeF
On Jan 29, 8:54 pm, Jean-Paul Calderone wrote: > On Thu, 29 Jan 2009 08:38:43 -0800 (PST), markobrie...@gmail.com wrote: > >G'day > > >I'm currently usingsocketserverto build a simple XMLSocket (an XML > >based protocol used for communication between flash and the outside > >world) server. I've go

Re: persistent TCP connection in python using socketserver

2009-01-31 Thread Stephen Hansen
Cheers mate I had a look into twisted but was put off by the FAQ stating 1.0+ modules may or may not be stable, and only the 'core' is. I don't wanna be messing around with a potentially buggy server, so im gonna roll my own using the sockets module. You didn't read that FAQ right: its addres

Re: persistent TCP connection in python using socketserver

2009-01-31 Thread markobrien85
On Jan 30, 5:54 am, Jean-Paul Calderone wrote: > On Thu, 29 Jan 2009 08:38:43 -0800 (PST), markobrie...@gmail.com wrote: > >G'day > > >I'm currentlyusingsocketserverto build a simple XMLSocket (an XML > >based protocol used for communication between flash and the outside > >world) server. I've got

Re: persistent TCP connection in python using socketserver

2009-01-29 Thread Jean-Paul Calderone
On Thu, 29 Jan 2009 08:38:43 -0800 (PST), markobrie...@gmail.com wrote: G'day I'm currently using socketserver to build a simple XMLSocket (an XML based protocol used for communication between flash and the outside world) server. I've got flash establishing a connection, sendin

persistent TCP connection in python using socketserver

2009-01-29 Thread markobrien85
G'day I'm currently using socketserver to build a simple XMLSocket (an XML based protocol used for communication between flash and the outside world) server. I've got flash establishing a connection, sending a request and my python server responding. However at this point socketse

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread James Mills
On Fri, Nov 7, 2008 at 1:43 AM, Ben Sizer <[EMAIL PROTECTED]> wrote: > On Nov 6, 12:46 am, "James Mills" <[EMAIL PROTECTED]> > wrote: >> >> Try these instead: >> * UDPServer >> ->http://trac.softcircuit.com.au/circuits/browser/examples/udpserver.py >> * UDPClient >> ->http://trac.softcircuit.c

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread Steve Holden
I D wrote: > Hello James, > Thanks for your response. > But I cannot use a third party software, I need to use the exisiting > API's within python. > As I am new to python, I suspected that I should go by a simpler > approach and so > scrapped off the below code and wrote a very simple UDP server c

Re: SocketServer shutdown deadlock

2008-11-06 Thread Okko Willeboordse
If I wait until _BaseServer__serving is True before calling shutdown things go better. Okko Willeboordse wrote: > All, > > With Python 2.5 SocketServer features the shutdown method that can be > called from another thread to stop the serve_forever loop. > > However; >

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread Ben Sizer
On Nov 6, 12:46 am, "James Mills" <[EMAIL PROTECTED]> wrote: > > Try these instead: >  * UDPServer > ->http://trac.softcircuit.com.au/circuits/browser/examples/udpserver.py >  * UDPClient   > ->http://trac.softcircuit.com.au/circuits/browser/examples/udpclient.py Since there's no contact details

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread I D
On Thu, Nov 6, 2008 at 10:27 AM, James Mills <[EMAIL PROTECTED]>wrote: > On Fri, Nov 7, 2008 at 12:57 AM, I D <[EMAIL PROTECTED]> wrote: > > Thanks for your response. > > But I cannot use a third party software, I need to use the exisiting > API's > > within python. > > Why ? @Sam@ That is the r

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread James Mills
On Fri, Nov 7, 2008 at 12:57 AM, I D <[EMAIL PROTECTED]> wrote: > Thanks for your response. > But I cannot use a third party software, I need to use the exisiting API's > within python. Why ? > Even this seems to lose packets, I would really appreciate if any pointers > can be provided to improve

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread I D
Hello James, Thanks for your response. But I cannot use a third party software, I need to use the exisiting API's within python. As I am new to python, I suspected that I should go by a simpler approach and so scrapped off the below code and wrote a very simple UDP server code as follows: logFileN

SocketServer shutdown deadlock

2008-11-06 Thread Okko Willeboordse
All, With Python 2.5 SocketServer features the shutdown method that can be called from another thread to stop the serve_forever loop. However; When the shutdown method is called before serve_forever, shutdown will never return. This can happen when a server is stopped during startup. In other

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-05 Thread James Mills
On Thu, Nov 6, 2008 at 9:53 AM, <[EMAIL PROTECTED]> wrote: > logFileName = 'log.txt' >logfile = open(logFileName, "a") >class MyUDPServer(SocketServer.UDPServer): >def server_bind(self): >self.socket.setsockopt(socket.SOL_SOCKET, > socket.SO_

Plz help..SocketServer UDP server losing lots of packets

2008-11-05 Thread id . engg
leExists(logFileName): logfile = open(logFileName, "a") logfile.writelines(self.rfile.readlines()) server = MyUDPServer(("",PORT), LogsDumpHandler) server.serve_forever() logfile.close() The above python code is a UDP server

Re: how do I stop SocketServer()?

2008-08-27 Thread Uberman
On Wed, 27 Aug 2008 18:44:46 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >Alexandru Mosoi wrote: > >> supposing that I have a server (an instance of SocketServer()) that >> waits for a connection (ie is blocked in accept()) and in another >> threa

Re: how do I stop SocketServer()?

2008-08-27 Thread Diez B. Roggisch
Alexandru Mosoi wrote: > supposing that I have a server (an instance of SocketServer()) that > waits for a connection (ie is blocked in accept()) and in another > thread i want to stop the server, how do I do that? By setting a timeout on the socket using socket.settimeout,

how do I stop SocketServer()?

2008-08-27 Thread Alexandru Mosoi
supposing that I have a server (an instance of SocketServer()) that waits for a connection (ie is blocked in accept()) and in another thread i want to stop the server, how do I do that? -- http://mail.python.org/mailman/listinfo/python-list

Re: SocketServer max connections

2008-08-27 Thread Laszlo Nagy
Guilherme Polo wrote: On Mon, Aug 25, 2008 at 7:20 AM, Ken Seehart <[EMAIL PROTECTED]> wrote: I'm using SocketServer to implement a local server that serves comet long-polling connections. How do I increase the maximum number of open connections? Currently it is limited to abou

Re: SocketServer max connections

2008-08-25 Thread Guilherme Polo
On Mon, Aug 25, 2008 at 7:20 AM, Ken Seehart <[EMAIL PROTECTED]> wrote: > I'm using SocketServer to implement a local server that serves comet > long-polling connections. > > How do I increase the maximum number of open connections? Currently it is > limited to about

SocketServer max connections

2008-08-25 Thread Ken Seehart
I'm using SocketServer to implement a local server that serves comet long-polling connections. How do I increase the maximum number of open connections? Currently it is limited to about 8 I think. More than that and it seems to block on opening more connections until one of the

SocketServer and long-polling connections

2008-08-25 Thread Ken Seehart
I apologize if this message is a repeat. It looks like didn't get received. I'm using SocketServer to implement a local server that serves comet long-polling connections. How do I increase the maximum number of open connections? Currently it is limited to about 8 I think. More

Re: SocketServer, its offspring, and threads

2008-06-04 Thread darel . finkbeiner
On May 25, 10:40 am, eliben <[EMAIL PROTECTED]> wrote: > Hello, > > I have a small wxPython application. Today I was trying to add some > RPC capability to it, so I implemented an instance of > SimpleXMLRPCServer that runs in a separate thread when invoked and > answers requests. > > All went fine

Re: SocketServer, its offspring, and threads

2008-05-28 Thread Tim Roberts
eliben <[EMAIL PROTECTED]> wrote: > >I ended up using an ugly hack to make it work for me. Since >handle_request() only blocks until a request is received, the thread >can be unblocked by sending it a real message. So to stop a server, I >opened a XML-RPC client connection (using ServerProxy from x

SocketServer, its offspring, and threads

2008-05-25 Thread eliben
rces which can't just be dropped suddenly, and have to be cleaned in a proper manner. (Does this sound like the truth ?) Anyway, this creates a problem because SimpleXMLRPCServer likes to block and never return. I dug deeper and found out that all offspring of SocketServer can only handle request

Safely updating master state in SocketServer with ForkingMixIn

2008-05-19 Thread Reid Priedhorsky
Dear all, I have a TCP server written using SocketServer with ForkingMixIn. Servicing connections is CPU-bound and can take several seconds. I now need a way to safely tell the master process to update its state (by groveling in a PostgreSQL database, potentially for several seconds). How can I

Re: Why does SocketServer default allow_reuse_address = false?

2007-03-07 Thread Joshua J. Kugler
Chris Mellon wrote: >> My problem (and the reason I set reuse to True) is this: if I have >> connections active when I restart my service, upon restart, the socket >> will >> fail to bind because there is still a connection in a WAIT state. > > This is just the way sockets work on your platform. H

Re: Why does SocketServer default allow_reuse_address = false?

2007-03-07 Thread Chris Mellon
ly option would be to sit there in a loop calling > serve_forever until it doesn't throw a "can't bind to socket" exception. > > Or is there something I'm *really* missing about the way SocketServer is > supposed to work? Am I supposed to notify my connection

Re: Why does SocketServer default allow_reuse_address = false?

2007-03-07 Thread Joshua J. Kugler
quot; exception. Or is there something I'm *really* missing about the way SocketServer is supposed to work? Am I supposed to notify my connection threads to shut down and disconnect "properly?" Which gets even more fun since they are sitting there waiting for input on the connection and n

Re: Why does SocketServer default allow_reuse_address = false?

2007-03-07 Thread Greg Copeland
clients connected]," and that > self.allow_reuse_address = False makes restarting a server a pain if there > were connected clients, why does SocketServer default allow_reuse_address > to False? It's kind of bemusing to subclass ThreadingTCPServer just to > change one variable that argua

Re: Why does SocketServer default allow_reuse_address = false?

2007-03-05 Thread Facundo Batista
lse makes restarting a server a pain if there > were connected clients, why does SocketServer default allow_reuse_address > to False? It's kind of bemusing to subclass ThreadingTCPServer just to > change one variable that arguably should have been True in the first place. > >

Why does SocketServer default allow_reuse_address = false?

2007-02-26 Thread Joshua J. Kugler
there were connected clients, why does SocketServer default allow_reuse_address to False? It's kind of bemusing to subclass ThreadingTCPServer just to change one variable that arguably should have been True in the first place. Is there some history to this of which I'm not aware? Is there a g

Re: Forking SocketServer daemon -- updating state

2007-02-20 Thread Nick Craig-Wood
Reid Priedhorsky <[EMAIL PROTECTED]> wrote: > I am implementing a forking SocketServer daemon that maintains significant > internal state (a graph that takes ~30s to build by fetching from a SQL > database, and eventually further state that may take up to an hour to > bui

Re: Forking SocketServer daemon -- updating state

2007-02-19 Thread Irmen de Jong
Reid Priedhorsky wrote: > Another possibility is that the signal handler simply sets a needs_update > flag, which I could check for in a handle_request() loop. The disadvantage > here is that the update wouldn't happen until after the next request is > handled, and I would like the state to be ava

Forking SocketServer daemon -- updating state

2007-02-19 Thread Reid Priedhorsky
Hi folks, I am implementing a forking SocketServer daemon that maintains significant internal state (a graph that takes ~30s to build by fetching from a SQL database, and eventually further state that may take up to an hour to build). I would like to be able to notify the daemon that it needs to

How to use SocketServer with IPv6

2007-02-12 Thread Tomi Hautakoski
Hello, I'm a Python newbie trying to figure out how to use SocketServer with IPv6. I would like to set up a TCPServer working like below but how to tell SocketServer I need to use AF_INET6? import SocketServer import logging as l l.basicConfig(level=l.DEBUG, f

  1   2   >