Networking Forums

Networking Forums > Computer Networking > Linux Networking > Getting file descriptor associated with a port

Reply
Thread Tools Display Modes

Getting file descriptor associated with a port

 
 
eyal.susser@gmail.com
Guest
Posts: n/a

 
      04-18-2006, 10:15 AM
Hi,

Is there a way to retrieve (using c) the port associated with a certain
file
descriptor?

Say I have a file descriptor returned from socket, which has been sent
to a call to bind(). At some stage, I want to retrieve the port number
associated with the socket. How is that done? I tried looking up the
ioctl_list, but couldn't really make heads ot tails of it...

For what I need, retrieving the file descriptor associated with a port
is also fine.

Thanks

 
Reply With Quote
 
 
 
 
eyal.susser@gmail.com
Guest
Posts: n/a

 
      04-18-2006, 10:32 AM
Wait...found it - getsockname, of course. Silly me.

 
Reply With Quote
Reply

Thread Tools
Display Modes

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
include port in hosts file John A Grandy Windows Networking 1 04-15-2009 01:04 PM
sending socket descriptor to another pid Beagle Linux Networking 2 07-09-2008 09:56 PM
atomicity / thread-safety: PF_PACKET socket and tap file descriptor Max Schmied Linux Networking 0 02-28-2007 10:31 AM
the FREEBSD4.11 file <bsd.port.mk> what should be use in REDHAT 8.0 yogesh Linux Networking 0 12-23-2006 06:51 PM
File Sharing Port? C Thomas Windows Networking 6 09-09-2005 06:00 PM



1 2 3 4 5 6 7 8 9 10 11