- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Socket program - Problem
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
Forums
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
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
05-21-2002 12:22 AM
05-21-2002 12:22 AM
Socket program - Problem
I have a socket program (client & server) which will broadcast a message from client to server. In both of the program, port no 1500 is allotted for this socket purpose. However the server side is getting terminated after sometime, giving the error "cannot bind port". Can any one tell me What could be the reason? & how can we check what are all the ports that are currently engaged by some other process?.
Thanks
Vasu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 12:41 AM
05-21-2002 12:41 AM
Re: Socket program - Problem
Use either netstat or lsof (more reliable) to identify whether the port is still in use:
# netstat -f inet | grep TCP | grep 1500
# lsof -i | grep TCP | grep 1500
You can get a copy of lsof from:
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.61/
Once you identify the process binding to the TCP port 1500, you can send a SIGTERM or SIGKILL to it so that the port is released. You can perform another lsof after the kill to verify the release.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 12:44 AM
05-21-2002 12:44 AM
Re: Socket program - Problem
Check your /etc/services to fetch out all already programmed port numbers allocated to be used.
Then, use the following command :
# netstat -a
to display active and passive ports and look if any of them is already in use ( ie. 1500 ).
Magdi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 12:45 AM
05-21-2002 12:45 AM
Re: Socket program - Problem
Your port is locked by something else
"cannot bind port". already in use
netstat -an is a good way to look but best is get lsof from the public domain
www.software.hp.com
public domain software
lsof
steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 12:47 AM
05-21-2002 12:47 AM
Re: Socket program - Problem
has an 'lsof' command available to download. Go to:
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin
and select 'lsof-4.45' from the list. The description is included below (and
there are 10.20 and 11.00 binaries available to download).
DESCRIPTION of LSOF:
-----------------------------
List files, sockets, etc opened by processes. Also gives a large amount of
other related information. Can select by process ID, username or filename. It
is a complete redesign of the fstat/ofiles utilities. This release now has lots
of additions and bug fixes including support for HP-UX 11.X.
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 12:52 AM
05-21-2002 12:52 AM
Re: Socket program - Problem
I made a slip on the netstat portion.
It should be:
# netstat -a | grep tcp | grep 1500
Instead of:
# netstat -f inet | grep TCP | grep 1500
The -a option will show the sockets in listen mode in addition to establishing or established connections.
Hope this helps. Regards.
Steven Sim Kok Leong