HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Trouble with 'socket' system call
Operating System - HP-UX
1834150
Members
2574
Online
110064
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
Forums
Discussions
Discussions
Discussions
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
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
12-24-2004 11:58 PM
12-24-2004 11:58 PM
Trouble with 'socket' system call
Hi.
I have server application, wich listen for socket, accepted connections and forks childs.
This app work properly many time, but something unknown occured yestoday.
After this 'accept' system call return error: 'Bad file descriptor'. I trace my application and see, that 'socket' system call return '0' value. After this my server can accept only one connection, and after this 'accept' return error.
Help me please.
I have server application, wich listen for socket, accepted connections and forks childs.
This app work properly many time, but something unknown occured yestoday.
After this 'accept' system call return error: 'Bad file descriptor'. I trace my application and see, that 'socket' system call return '0' value. After this my server can accept only one connection, and after this 'accept' return error.
Help me please.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2004 09:16 AM
12-26-2004 09:16 AM
Re: Trouble with 'socket' system call
When your server forks the child process, does it remember to call close() on the descriptor returned by the accept() call? (This is in the server, not the child) If it does not, eventually, your server process will hit the ceiling for maximum number of open file descriptors - the maxfiles system tunable.
Also, is the socket() call returning 0, or is it actually returning -1 and setting errno to something?
Also, is the socket() call returning 0, or is it actually returning -1 and setting errno to something?
there is no rest for the wicked yet the virtuous have no pillows
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2004 03:02 PM
12-26-2004 03:02 PM
Re: Trouble with 'socket' system call
Hi Rick.
I'am close socket in parent after fork, of course. At the begin i also think that limit of opened descriptors are riched.
But i restart server, run application and problem don't go away.
Socket function not return -1 and not set errno.
It return 0. After this application can accept only first connection (this connection is work properly). But after first accept all another accept calls returns -1 and set errno = 'Bad file descriptor'.
I'am close socket in parent after fork, of course. At the begin i also think that limit of opened descriptors are riched.
But i restart server, run application and problem don't go away.
Socket function not return -1 and not set errno.
It return 0. After this application can accept only first connection (this connection is work properly). But after first accept all another accept calls returns -1 and set errno = 'Bad file descriptor'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2004 12:37 PM
12-27-2004 12:37 PM
Re: Trouble with 'socket' system call
use tusc to trace the system/socket calls and make sure the subsequent calls have the fd's you expect them to.
there is no rest for the wicked yet the virtuous have no pillows
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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP