how to check port already used in pcap pgm

hi,

I am writing one packet receiving program using libpcap library.

Now, I want to check port is already using or not.

how to check in receiver program..

If normal program,using bind return value we can able to check the port is already using or not.

but, in pcap program how can i check?

thank you.

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.