closing sockets

Grant Edwards grante at visi.com
Tue Oct 4 20:22:15 CEST 2005


On 2005-10-04, Mohammed Smadi <smadim2 at grads.ece.mcmaster.ca> wrote:
> hi;
>
> i am executing program whcih uses a tcp socket.  At the end of the program 
> i do s.close() where s is my socket.
>
> when i try to run the program again right away i get the following error
> Traceback (most recent call last):
>   File "asterisk_login.py", line 14, in ?
>     s.bind(("", hp_port)) # do some error checking
>   File "<string>", line 1, in bind
> socket.error: (98, 'Address already in use')
>
> how can i get around that

http://www.google.com/search?hl=en&q=socket.error%3A+%2898%2C+%27Address+already+in+use%27%29&btnG=Google+Search

The first hit has this link which explains it very well:

http://hea-www.harvard.edu/~fine/Tech/addrinuse.html

-- 
Grant Edwards                   grante             Yow!  I want to kill
                                  at               everyone here with a cute
                               visi.com            colorful Hydrogen Bomb!!



More information about the Python-list mailing list