- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- bind port 0 failed with error "AddressInUse"
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 08:30 AM
04-18-2017 08:30 AM
bind port 0 failed with error "AddressInUse"
Hi All,
1. I written a client-server code.
2. The process listens at TCP PORT#2000
3. The client process needs to connect to server process but before connecting to server process, I made attempt to bind() the local address for any of the available ports and for that I tried to bind the address as "tcp://0.0.0.0:0"
4. Ideally when you attempt to bind the address tcp://0.0.0.0:0, then it should bind it any of the available free port.
5. It should not fail with "Address in use" error.
6. It is not clear to me why bind (tcp://0.0.0.0:0) failed with "AddressInUse" error.
Could you please explain when bind (tcp://0.0.0.0:0) failes with "AddressInUse" error?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 02:24 PM
04-18-2017 02:24 PM
Re: bind port 0 failed with error "AddressInUse"
> 1. I written a client-server code.
I can't see it. It's usually easier for me to debug code when I can
see the code.
> 2. The process listens at TCP PORT#2000
Is that "The process" the _server_?
> 3. The client process needs to connect to server process but before
> connecting to server process, I made attempt to bind() the local address
> for any of the available ports and for that I tried to bind the address
> as "tcp://0.0.0.0:0"
I don't do much socket programming, so I know nothing, but why is the
client using bind()? Why not connect()? See, for example:
http://www.thegeekstuff.com/2011/12/c-socket-programming/
(Or do a Web search for keywords like, say:
tcp client server example
and see what you find.)