<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bind one port by 2 programs ( Error : Port Already In Use ) in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315277#M567862</link>
    <description>From the sound of it you may want to do a network trace as well as a system call trace of the application.  &lt;BR /&gt;&lt;BR /&gt;Just and FYI you can get a "swinstallable" version of ethereal and tcpdump off of HP's Internet Express Media:&lt;BR /&gt;&lt;BR /&gt;Its available for 11.11 11.23&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXIEXP1111" target="_blank"&gt;http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXIEXP1111&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You could use tusc also to see what the source code is doing by setting it up to follow the listener PID. Use the -f option to follow forks. &lt;BR /&gt;&lt;BR /&gt;Something like this:&lt;BR /&gt;&lt;BR /&gt;tusc -aeflpT "" -o tusc.out PID_OF_APP&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://gatekeep.cs.utah.edu/hppd/hpux/Sysadmin/tusc-7.5/" target="_blank"&gt;http://gatekeep.cs.utah.edu/hppd/hpux/Sysadmin/tusc-7.5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;Todd&lt;BR /&gt;</description>
    <pubDate>Tue, 29 Jun 2004 06:37:45 GMT</pubDate>
    <dc:creator>Todd Whitcher</dc:creator>
    <dc:date>2004-06-29T06:37:45Z</dc:date>
    <item>
      <title>Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315261#M567846</link>
      <description>F1... F1... F1...&lt;BR /&gt;Hi All ,&lt;BR /&gt;&lt;BR /&gt;I want to bind the port which is already in use by another process.( without making the changes in the first processs source code ) &lt;BR /&gt;&lt;BR /&gt;Rahul.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jun 2004 04:08:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315261#M567846</guid>
      <dc:creator>Rahul_19</dc:creator>
      <dc:date>2004-06-25T04:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315262#M567847</link>
      <description>You can't.&lt;BR /&gt;&lt;BR /&gt;Only one server process can listen on a port at the same time.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jun 2004 04:11:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315262#M567847</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-06-25T04:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315263#M567848</link>
      <description>One port can be assigned to one service only. Look at /etc/services file.&lt;BR /&gt;&lt;BR /&gt;sks</description>
      <pubDate>Fri, 25 Jun 2004 04:14:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315263#M567848</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-06-25T04:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315264#M567849</link>
      <description>Fred just stole my "You can't" post :) &lt;BR /&gt; &lt;BR /&gt;The usual way of dealing with the problem is for an application to get a connection from the client, negotiate a new port to communicate over and fork.</description>
      <pubDate>Fri, 25 Jun 2004 04:16:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315264#M567849</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-06-25T04:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315265#M567850</link>
      <description>hv'nt u already raised a thread for the same ?&lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Fri, 25 Jun 2004 04:19:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315265#M567850</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2004-06-25T04:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315266#M567851</link>
      <description>Ok  Fred / Sanjay do you have any Alternative on this , because I what to monitor Port to check whether there is any data has arrived or not , and I donâ  t have the source code for The first process .&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rah</description>
      <pubDate>Fri, 25 Jun 2004 04:23:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315266#M567851</guid>
      <dc:creator>Rahul_19</dc:creator>
      <dc:date>2004-06-25T04:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315267#M567852</link>
      <description>Use lsof to monitor that port ..&lt;BR /&gt;&lt;BR /&gt;use lsof to find out the process which is using that port , I do not think port numbers will be stored in a source-code , it should be in a config file .. &lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Fri, 25 Jun 2004 04:45:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315267#M567852</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2004-06-25T04:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315268#M567853</link>
      <description>Mark,&lt;BR /&gt;&lt;BR /&gt;It was real fun :)&lt;BR /&gt;Server/Agent process does not free the port, in general case, cause when Server and Client negociate the port, then Server forks to an agent, and come back listening on this port... So it is not free.&lt;BR /&gt;&lt;BR /&gt;Rahul,&lt;BR /&gt;&lt;BR /&gt;What you need is a snifer program. The easiests (and also free) will be tcpdump and ethereal. I use them on Linux. I don't know for ethereal, but I've seen on this forum that tcpdump can be compiled on HP. Nevertheless, you can use another machine on the network to snif with this programs... They can show you traffic for specific port on specific IP, and a lot much.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jun 2004 04:52:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315268#M567853</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-06-25T04:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315269#M567854</link>
      <description>AlrFred,&lt;BR /&gt;&lt;BR /&gt;Alright Fred , Guys &lt;BR /&gt;Since I can not bind the port which is used by the another process then I came up with another solution check the following script , but it gives me the Interface error ( we can put this in the demon (Fork ) ) and accomplish the task please give your suggestion ASAP &lt;BR /&gt;&lt;BR /&gt;#!/bin/csh &lt;BR /&gt;&lt;BR /&gt;set PORT = $1&lt;BR /&gt;if ($PORT == "") then echo -n "port&amp;gt; " set PORT = $&amp;lt; endif &lt;BR /&gt;&lt;BR /&gt;set IP=`/usr/sbin/ifconfig -a | grep inet | grep -v 127.0.0.1 | \ awk '{print $2}'` &lt;BR /&gt;&lt;BR /&gt;foreach STATE ( ESTABLISHED LAST_ACK CLOSING TIME_WAIT CLOSE_WAIT LISTEN IDLE ) set CNT=`netstat -an | grep $IP.$PORT | grep $STATE | wc -l` echo $STATE ":" $CNT end &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards &lt;BR /&gt;Rahul&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jun 2004 05:06:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315269#M567854</guid>
      <dc:creator>Rahul_19</dc:creator>
      <dc:date>2004-06-25T05:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315270#M567855</link>
      <description>Rahul,&lt;BR /&gt;&lt;BR /&gt;I would like to clarify a point :&lt;BR /&gt;Do your want to know if there is traffic on a port, or do you want to know if someone is listening on a port ?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jun 2004 05:37:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315270#M567855</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-06-25T05:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315271#M567856</link>
      <description>Fred, &lt;BR /&gt;Hear is the Situation &lt;BR /&gt;&lt;BR /&gt;What I Have:&lt;BR /&gt;&lt;BR /&gt;One program using the port say 20000&lt;BR /&gt;(For Which I donâ  t have source code but I know the port number it is listening to )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What I want:&lt;BR /&gt;&lt;BR /&gt;I want to send the signal to another process to do some other job as soon as some data is arrived on the port no 20000.&lt;BR /&gt;&lt;BR /&gt;Now how do we do this????&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rahul</description>
      <pubDate>Fri, 25 Jun 2004 06:08:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315271#M567856</guid>
      <dc:creator>Rahul_19</dc:creator>
      <dc:date>2004-06-25T06:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315272#M567857</link>
      <description>The easiest way would be to trace log for application, but I imagine you don't have one...&lt;BR /&gt;&lt;BR /&gt;Now what you can do is to install lsof or tcpdump, and make them monitor that port. As soon as they tell you so, you can launch your work.&lt;BR /&gt;&lt;BR /&gt;You should have a look at both lsof and tcpdump, as long as they do not act the same (tcpdump monitors network traffic, lsof monitors files, but as long as sockets are files...)&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Jun 2004 07:14:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315272#M567857</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-06-25T07:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315273#M567858</link>
      <description>you seem to have posted the same question twice...&lt;BR /&gt;&lt;BR /&gt;see the other thread about LD_PRELOAD&lt;BR /&gt;&lt;BR /&gt;as for tcpdump, if you are scripting, you would use tcpdump.  ifyou are programming, you would use libpcap (which is used by tcpdump).  keep in mind that the overhead of promiscuous mode is non-trivial so using tcpdump will consume a fair amount of CPU time - particularly when the network traffic rates are high.  if the rates are rather low (rates into an interface, not just the one application/port you wish to monitor) then it may not matter.&lt;BR /&gt;&lt;BR /&gt;an indirect way to go would be to parse the output of ndd /dev/tcp tcp_status and notice when the receive sequence numbers change.  that means that data has arrived at TCP for the given connection, but does not necessarily mean it has been read by the application.</description>
      <pubDate>Sat, 26 Jun 2004 10:46:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315273#M567858</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2004-06-26T10:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315274#M567859</link>
      <description>Hi rahul,&lt;BR /&gt;You check whether that port is listening or requesting clinets request by command:&lt;BR /&gt;&lt;BR /&gt;# netstat -a&lt;BR /&gt;Use "cut" to capture the appropriate field.&lt;BR /&gt;see man netstat,cut&lt;BR /&gt;&lt;BR /&gt;Don't know how much this will help.&lt;BR /&gt;Regards,</description>
      <pubDate>Sat, 26 Jun 2004 11:13:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315274#M567859</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-06-26T11:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315275#M567860</link>
      <description>&lt;BR /&gt;Fred Ruffet : &lt;BR /&gt;Rick jones : &lt;BR /&gt;Kapil : &lt;BR /&gt;Bharat Katkar :&lt;BR /&gt;&lt;BR /&gt;Ok..........&lt;BR /&gt;&lt;BR /&gt;Please Check the following site &lt;A href="http://www.tcptrace.org/" target="_blank"&gt;http://www.tcptrace.org/&lt;/A&gt;&lt;BR /&gt;Please find and download the file tcptrace-6.6.1.tar on net it has most of the source code for &lt;BR /&gt;Tcpdump and tcptrace , I am trying to dig out most of it. It might be useful for all the UNIX guys. Or You may download the Tcptrace from the same site : &lt;A href="http://www.tcptrace.org/" target="_blank"&gt;http://www.tcptrace.org/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;GOOD LUCK......... Guys&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Rahul&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Jun 2004 05:10:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315275#M567860</guid>
      <dc:creator>Rahul_19</dc:creator>
      <dc:date>2004-06-28T05:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315276#M567861</link>
      <description>Rahul,&lt;BR /&gt;&lt;BR /&gt;If you have access to the client process, and the client can be configured to connect to a different port, say 20001 instead of 20000, then you could write a server side proxy program.  The proxy program would listen for any connections on port 20001 coming from the client.  The proxy would would also open a connection via the loopback interface to the "real" server program on port 20000.  Whenever the proxy receives data from the client it would pass it directly to the "real" server and send a signal to your other process.  The proxy would also have to pass data from the "real" server back to the client. &lt;BR /&gt;&lt;BR /&gt;Using this method you don't have to parse any logfiles, you don't have to worry about the overhead of promiscusous mode, and you should never miss a single byte of data that gets passed to the server.&lt;BR /&gt;&lt;BR /&gt;-JL</description>
      <pubDate>Mon, 28 Jun 2004 07:13:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315276#M567861</guid>
      <dc:creator>James Lynch</dc:creator>
      <dc:date>2004-06-28T07:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315277#M567862</link>
      <description>From the sound of it you may want to do a network trace as well as a system call trace of the application.  &lt;BR /&gt;&lt;BR /&gt;Just and FYI you can get a "swinstallable" version of ethereal and tcpdump off of HP's Internet Express Media:&lt;BR /&gt;&lt;BR /&gt;Its available for 11.11 11.23&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXIEXP1111" target="_blank"&gt;http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXIEXP1111&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You could use tusc also to see what the source code is doing by setting it up to follow the listener PID. Use the -f option to follow forks. &lt;BR /&gt;&lt;BR /&gt;Something like this:&lt;BR /&gt;&lt;BR /&gt;tusc -aeflpT "" -o tusc.out PID_OF_APP&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://gatekeep.cs.utah.edu/hppd/hpux/Sysadmin/tusc-7.5/" target="_blank"&gt;http://gatekeep.cs.utah.edu/hppd/hpux/Sysadmin/tusc-7.5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;Todd&lt;BR /&gt;</description>
      <pubDate>Tue, 29 Jun 2004 06:37:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315277#M567862</guid>
      <dc:creator>Todd Whitcher</dc:creator>
      <dc:date>2004-06-29T06:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Bind one port by 2 programs ( Error : Port Already In Use )</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315278#M567863</link>
      <description>James Lynch / Todd / ALL&lt;BR /&gt;&lt;BR /&gt; Thanks guys, I am trying to do all the things possible to accomplish the job&lt;BR /&gt; All guys have added the new different avenues to the exercise to find the &lt;BR /&gt;solutions for the above said problem.&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards&lt;BR /&gt;&lt;BR /&gt;Rahul&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 29 Jun 2004 23:37:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/bind-one-port-by-2-programs-error-port-already-in-use/m-p/3315278#M567863</guid>
      <dc:creator>Rahul_19</dc:creator>
      <dc:date>2004-06-29T23:37:58Z</dc:date>
    </item>
  </channel>
</rss>

