473,396 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

closing sockets

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

thanks
smadi

Oct 4 '05 #1
2 1257
On 2005-10-04, Mohammed Smadi <sm*****@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...=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!!
Oct 4 '05 #2
On 2005-10-04, Grant Edwards <gr****@visi.com> wrote:
socket.error: (98, 'Address already in use')

how can i get around that


http://www.google.com/search?hl=en&q...=Google+Search

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

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


And the second hit has a link to exact python spelling of the
solution explained in the first hit:

http://mail.python.org/pipermail/pyt...il/275088.html

--
Grant Edwards grante Yow! Send your questions
at to "ASK ZIPPY", Box 40474,
visi.com San Francisco, CA 94140,
USA
Oct 4 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: simon place | last post by:
Spent some very frustrating hours recoding to find a way of closing a server socket, i'd not thought it would be any problem, however, after complete failure and as a last resort, i looked at the...
3
by: Anand Pillai | last post by:
I recently noted that urllib2.urlopen(...) for http:// urls does not make an explicit call to close the underlying HTTPConnection socket once the data from the socket is read. This might not be...
4
by: flupke | last post by:
Hi, I have a gui (made in wxPython) that enables a user to connect to a server and issue some commands. The problem occurs when i try to disconnect the client. It exits but it doesn't return to...
1
by: Daniel | last post by:
after opening socket, sending data then closing socket 3000 times i get "Only one usage of each socket address" what am i doing wrong? is there some thing else i need to do to free up the socket...
5
by: Alper AKCAYOZ | last post by:
Hello Developers, I have developed Server and Client applications that are communicating by TCP/IP sockets. My application is developed on Visual C++ .NET Standard v2003 Windows Forms. When one of...
3
by: Tom Opgenorth | last post by:
I'm experiencing a problem with sockets, and I'm really hoping someone can help me, please and thank you. I've written a TCP Server, which listens on a port for an incoming connection. When the...
2
by: Lenard Gunda | last post by:
Hi, I have the following problem when I am working with sockets in C#. I do not remember running into the same problem some while ago, when working with sockets from C++ (using native code, not...
2
by: Macca | last post by:
Hi, I am writing an app that will have a socket server to listen for and process data from 20+ clients. These clients will send data aproximately every 400-500ms. I was wondering if it is...
8
by: Dinsdale | last post by:
I am trying to write a Tcp "Server" that opens a class that wraps a tcp socket when a new connection is made (Listener.AcceptSocket()). Everything is going swimmingly except when I try to close the...
4
by: Funke | last post by:
Assume that in C#, I create a server socket (listener) and code to start new threads with each connection using BeginAccept(). After some time, I have three threads running, each with their own...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.