- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Relationship between socket and file descriptor
Operating System - HP-UX
1821584
Members
3414
Online
109633
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО06-12-2005 11:48 AM
тАО06-12-2005 11:48 AM
Relationship between socket and file descriptor
Hi Guys,
Can anyone throw some light on what is the difference between socket and file descriptors on hpux 11i ?
What are the commands to find them ?
Thanks,
Shiv
Can anyone throw some light on what is the difference between socket and file descriptors on hpux 11i ?
What are the commands to find them ?
Thanks,
Shiv
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2005 07:42 PM
тАО06-12-2005 07:42 PM
Re: Relationship between socket and file descriptor
Hi,
a fildescriptor is how a process can see a socket, an open file, a pipe.
What sort of information do you want to get from filedesc and socket and files?
a fildescriptor is how a process can see a socket, an open file, a pipe.
What sort of information do you want to get from filedesc and socket and files?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2005 02:32 AM
тАО06-13-2005 02:32 AM
Re: Relationship between socket and file descriptor
What kind of difference are you looking for?
For second part of your query, If you are looking for open files for process , lsof command could be useful. You can download one from
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/
For second part of your query, If you are looking for open files for process , lsof command could be useful. You can download one from
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2005 04:01 AM
тАО06-13-2005 04:01 AM
Re: Relationship between socket and file descriptor
Sockets are actually implemented as file descriptors so all sockets are file descriptors but the converse is not true. The first step in the process is the socket() system call. It returns a small integer (a file descriptor) but no actual network connection exists at this point. The next step is to associate this file descriptor with a network connection and that is the job of the connect() or bind() system calls.
If you really want to understand the socket mechanism, I suggest that you look at Perl's IO::Socket module. The steps you do there are simplified versions of the same process in C; there's no easier way to build a client/server pair than with IO::Socket and the modules come with documentation and examples.
If you want to see open sockets on a running system, lsof is hard to beat. You can download it from any of the HP-UC Porting Centre's.
If you really want to understand the socket mechanism, I suggest that you look at Perl's IO::Socket module. The steps you do there are simplified versions of the same process in C; there's no easier way to build a client/server pair than with IO::Socket and the modules come with documentation and examples.
If you want to see open sockets on a running system, lsof is hard to beat. You can download it from any of the HP-UC Porting Centre's.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP