connection to server not accepted (but no error) only after several hours

seb sebastien.thur at laposte.net
Thu Jan 18 11:40:56 EST 2007


Hi Dennis,

I think I have some new informations.
My system is "blocked" now but the following change make it work again
!!!
I will test it for tonight to be sure of the improvements.

I changed :
               service.bind(("", self.PORT))
to
		service.bind((socket.gethostname(), self.PORT))

The strange thing is that using the "" it works for a few hours.

Regards.
Sebastien.


Dennis Lee Bieber a écrit :
> On 17 Jan 2007 00:08:52 -0800, "seb" <sebastien.thur at laposte.net>
> declaimed the following in comp.lang.python:
>
> >
> > 1) I have enabled one time server that can be run as a service (R C C
> > time server) and this service is responding correctly, when at the same
> > time (before I kill it ) the python time server is not responding.
> >
>
> 	What behavior do you see if you don't run them as background
> services, but rather from a regular console login?
>
> > 2) I have also tried two python time server downloaded from effbot
> > site. Both are not responding after the "non response from the time
> > server I rn" even for the first interrogation once they are started.
> > (Of course I have killed my time server when I run a new one).
> > Same behaviour no response given but no error neither.
> >
> 	If you've now got a total of three programs that are not reporting
> error conditions, I'd suspect there is something else wrong in the
> system...
>
> > It is only python programs that are listening from the port 37 that are
> > blocked at a certain time.
> > How is it possible (without firewall enabled) ?
> >
> 	What response do you get from the clients attempting to connect to
> this server? (I'd expect a either a flat out "denied" or, for a
> stealthed firewall, a timeout with no response).
>
>
> 	You also have a race condition in your log-file...
>
> > 	a.start()
> > 	a.set_log_file("log_nw.txt")
> > 	a.reset_log_file()
>
> 	It is possible that the thread gets a few connections between the
> .start() and the .set_log_file() and logs them to the default file name.
> Also, it is possible for connections to be logged between the
> .set_log_file() and the .reset_log_file() (where you wipe out the
> contents of the log file).
>
> 	I'd suggest putting the .start() call third in that list. That way
> you create the thread object, but it is not running. Change the log file
> name, wipe out any old contents, and THEN start the thread running.
>
> 	My only other comment would be to add a few wolf-fences... Print
> statements (if running in a console), or more logging messages (you
> might want to make a method out of that internal logging so all you code
> is, say
>
> 		self.slog("message")
>
> and "slog" does that time stamping, and file open/close...
>
> 	By logging each main step (accept, send, close) you might find where
> it stops.
> --
> 	Wulfraed	Dennis Lee Bieber		KD6MOG
> 	wlfraed at ix.netcom.com		wulfraed at bestiaria.com
> 		HTTP://wlfraed.home.netcom.com/
> 	(Bestiaria Support Staff:		web-asst at bestiaria.com)
> 		HTTP://www.bestiaria.com/




More information about the Python-list mailing list