The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to bind a process to a CPU Raom UNIX for Advanced & Expert Users 11 08-17-2007 12:16 PM
Bind and AIX zuessh AIX 0 09-15-2006 11:19 AM
FTP, DNS & BIND patras UNIX for Dummies Questions & Answers 4 07-03-2006 03:34 AM
BIND question vertigo23 IP Networking 3 10-18-2005 10:05 AM
BIND Ver. 8 alwayslearningunix Security 2 03-27-2001 04:56 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-19-2008
zing_foru zing_foru is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 38
Bind failure

Hi all,

I am using Perl program to do socket communication. My application has to use port 40001 this is a condition I can't change the port.

The execution of this script always gave an error 'Bind failure port already in use'

netstat execution gives below line:
udp 0 0 *.40001 *.*

What this line indicates. I think due this port engagement bind fails. To fix this issue I used port reuse option as below before bind but still bind gives the same error:

setsockopt($serv_sock, IPPROTO_UDP, SO_REUSEADDR, pack("l", 1)) || die "setsockopt: $!";

How can I disengage the port binding?
Please help me in this regard...

Thanks...
  #2 (permalink)  
Old 01-19-2008
frank_rizzo frank_rizzo is offline Forum Advisor  
Resident BOFH
  
 

Join Date: Dec 2007
Posts: 423
you cannot bind to a port that is in use. There is a process that has this open. Use lsof -i to find the pid and kill it.
  #3 (permalink)  
Old 01-19-2008
zing_foru zing_foru is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 38
I am using HP-UX B.11.11 .. there is no lsof command.
  #4 (permalink)  
Old 01-19-2008
frank_rizzo frank_rizzo is offline Forum Advisor  
Resident BOFH
  
 

Join Date: Dec 2007
Posts: 423
not sure of an alternative then.

could it be possible that the program your running is already running ?

ps -ef|grep your_process

if so, kill it.
  #5 (permalink)  
Old 01-19-2008
zing_foru zing_foru is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 38
Actually the thing is my program is not running .. from start I am getting this error. So some other unknown process may using this port. How can I detect the process which uses this 40001 port so that I can kill it. Also I rebooted my machine but then also I find 40001 port engaged with some processes.

OR

Is there any best way to remove this port socket entry from TCB [transmission control block]?

Thanks...
  #6 (permalink)  
Old 01-19-2008
frank_rizzo frank_rizzo is offline Forum Advisor  
Resident BOFH
  
 

Join Date: Dec 2007
Posts: 423
install lsof. If you can't then I don't know what to tell you.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:43 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0