socket.error: [Errno 98] Address already in use
Grant Edwards
invalid at invalid.invalid
Wed Sep 15 14:58:32 EDT 2010
On 2010-09-15, cerr <ron.eggler at gmail.com> 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((host, port))
> s.listen(1)
> ...
> ...
> ...
> while loop:
> conn, addr = s.accept()
> while conn and loop:
> ...
> ...
> ...
> conn.close()
At what line does the error occur?
To what does the phrase "open a socket" refer?
Have you tried the usual solution of setting the SO_REUSEADDR option
on the socket before calling bind?
http://www.google.com/search?q=socket+%27address+already+in+use%27
--
Grant Edwards grant.b.edwards Yow! I own seven-eighths of
at all the artists in downtown
gmail.com Burbank!
More information about the Python-list
mailing list