Re: socket.error: [Errno 98] Address already in use

2010-09-21 Thread Nobody
On Mon, 20 Sep 2010 12:00:41 +1200, Lawrence D'Oliveiro wrote: >> However, some clients choose their own source ports. E.g. rlogin/rsh use >> privileged (low-numbered) ports, and you can't get the kernel to choose a >> random privileged port for you. > > But nobody uses rlogin/rsh any more, They

Re: socket.error: [Errno 98] Address already in use

2010-09-19 Thread Lawrence D'Oliveiro
In message , Nobody wrote: > However, some clients choose their own source ports. E.g. rlogin/rsh use > privileged (low-numbered) ports, and you can't get the kernel to choose a > random privileged port for you. But nobody uses rlogin/rsh any more, and who would attach any trustworthy meaning to

Re: socket.error: [Errno 98] Address already in use

2010-09-19 Thread Nobody
On Sun, 19 Sep 2010 18:42:51 +1200, Lawrence D'Oliveiro wrote: That's why Stevens recommends that all TCP servers use the SO_REUSEADDR socket option. >>> >>> I don’t think I’ve ever used that. It seems to defeat a safety mechanism >>> which was put in for a reason. >> >> It was put in

Re: socket.error: [Errno 98] Address already in use

2010-09-18 Thread Lawrence D'Oliveiro
In message , Nobody wrote: > On Sun, 19 Sep 2010 12:27:08 +1200, Lawrence D'Oliveiro wrote: > >>> That's why Stevens recommends that all TCP servers use the >>> SO_REUSEADDR socket option. >> >> I don’t think I’ve ever used that. It seems to defeat a safety mechanism >> which was put in for a re

Re: socket.error: [Errno 98] Address already in use

2010-09-18 Thread Nobody
On Sun, 19 Sep 2010 12:27:08 +1200, Lawrence D'Oliveiro wrote: >> That's why Stevens recommends that all TCP servers use the >> SO_REUSEADDR socket option. > > I don’t think I’ve ever used that. It seems to defeat a safety mechanism > which was put in for a reason. It was put in for the benefit

Re: socket.error: [Errno 98] Address already in use

2010-09-18 Thread Lawrence D'Oliveiro
In message , Jorgen Grahn wrote: > That's why Stevens recommends that all TCP servers use the > SO_REUSEADDR socket option. I don’t think I’ve ever used that. It seems to defeat a safety mechanism which was put in for a reason. -- http://mail.python.org/mailman/listinfo/python-list

Re: socket.error: [Errno 98] Address already in use

2010-09-18 Thread Jorgen Grahn
On Sat, 2010-09-18, Lawrence D'Oliveiro wrote: > In message > <2f830099-4264-47bc-98ee-31950412a...@q21g2000prm.googlegroups.com>, cerr > wrote: > >> I get a socket error "[Errno 98] Address already in use" when i try to >> open a socket that got closed before with close(). How come close() >> do

Re: socket.error: [Errno 98] Address already in use

2010-09-18 Thread Lawrence D'Oliveiro
In message , Grant Edwards wrote: > Even when the connection was properly terminated (from an > application's POV), there's a TIME_WAIT period before the TCP stack > considered the connection completely gone and will allow re-use of the > port. I’m not so sure about that. I’ve done a bunch of dev

Re: socket.error: [Errno 98] Address already in use

2010-09-18 Thread Grant Edwards
On 2010-09-18, Lawrence D'Oliveiro wrote: > In message ><2f830099-4264-47bc-98ee-31950412a...@q21g2000prm.googlegroups.com>, cerr > wrote: > >> I get a socket error "[Errno 98] Address already in use" when i try to >> open a socket that got closed before with close(). How come close() >> doesn't

Re: socket.error: [Errno 98] Address already in use

2010-09-17 Thread Lawrence D'Oliveiro
In message <2f830099-4264-47bc-98ee-31950412a...@q21g2000prm.googlegroups.com>, cerr wrote: > I get a socket error "[Errno 98] Address already in use" when i try to > open a socket that got closed before with close(). How come close() > doesn't close the socket properly? The usual case this hap

Re: socket.error: [Errno 98] Address already in use

2010-09-16 Thread björn lundin
> Where line 75 contains following: > s.bind((host, port)) As Tomas pointed out, you close conn, but you do not close the server socket 's' /Björn -- http://mail.python.org/mailman/listinfo/python-list

Re: socket.error: [Errno 98] Address already in use

2010-09-16 Thread cerr
ile conn and loop: > > ... > > ... > > ... > >      conn.close() > > At what line does the error occur? The whole message I get looks like: Traceback (most recent call last): File "./checkGPIO.py", line 148, in main() File "./checkGPIO.py",

Re: socket.error: [Errno 98] Address already in use

2010-09-16 Thread cerr
On Sep 15, 5:51 pm, "jipalaciosort...@gmail.com" wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > El 15/09/2010 20:58, Grant Edwards escribió: > > > > > On 2010-09-15, cerr wrote: > > >> I get a socket error "[Errno 98] Address already in use" when i > >> try to open a socket that got

Re: socket.error: [Errno 98] Address already in use

2010-09-15 Thread jipalaciosort...@gmail.com
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 El 15/09/2010 20:58, Grant Edwards escribió: > On 2010-09-15, cerr wrote: > >> I get a socket error "[Errno 98] Address already in use" when i >> try to open a socket that got closed before with close(). How >> come close() doesn't close the socket p

Re: socket.error: [Errno 98] Address already in use

2010-09-15 Thread Grant Edwards
On 2010-09-15, cerr wrote: > I get a socket error "[Errno 98] Address already in use" when i try to > open a socket that got closed before with close(). How come close() > doesn't close the socket properly? > My socket code : > > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.bind(

Re: socket.error: [Errno 98] Address already in use

2010-09-15 Thread Thomas Jollans
On Wednesday 15 September 2010, it occurred to cerr to exclaim: > Hi There, > > I get a socket error "[Errno 98] Address already in use" when i try to > open a socket that got closed before with close(). How come close() > doesn't close the socket properly? > My socket code : > > s = socket.soc

socket.error: [Errno 98] Address already in use

2010-09-15 Thread cerr
Hi There, I get a socket error "[Errno 98] Address already in use" when i try to open a socket that got closed before with close(). How come close() doesn't close the socket properly? My socket code : s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host, port)) s.listen(1) ...