- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Is close() required after using socket_fd()
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
10-07-2010 04:15 AM
10-07-2010 04:15 AM
Is close() required after using socket_fd()
When we're done with the device is it sufficient to call $dassgn to close the channel/device or do we also (or instead?) need to call close() on the result from socket_fd() to release some other internal structures which got created?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2010 05:52 AM
10-07-2010 05:52 AM
Re: Is close() required after using socket_fd()
I wouldn't prefer to mix sockets and system service APIs.
With strictly system services, $deassgn is enough.
If you're going to try this mixing, then while I'd assume $deassgn is enough, I'd also write a test program and try a gazillion of whatever (missing) function might be (in a loop), and look for leaks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2010 05:58 AM
10-07-2010 05:58 AM
Re: Is close() required after using socket_fd()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2010 06:09 AM
10-07-2010 06:09 AM
Re: Is close() required after using socket_fd()
The 'missing' function is select().
Using only VMS services select() is easily and more flexible replaced by a combination of async. $QIO, eventflags and/or ASTs, and either a wait for eventflags, or $hiber and awake from an AST.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2010 06:49 AM
10-07-2010 06:49 AM
Re: Is close() required after using socket_fd()
That's more work and more code complexity and more support, for less features and slower code. Use ASTs. Or (if you need portability, which is less likely given the use of $qio) maybe threads.
While a more modern C environment does threading and asynchronous processing rather easily, unfortunately C on VMS is rather stale. Give you're already using the $qio calls, you can get where you want with this.
Here's a generic AST example:
http://labs.hoffmanlabs.com/node/617
Though this is definitely a different application design approach for the code; this is event-driven code, rather than waiting for flags. (Which might push you back into event flag waits via lib$get_ef calls and $qio calls and the $wflor and such. Into the ancient select-style programming model.) If the event-driven code is done "right", it's often rather cleaner than the old-style select-based stuff, too.
Please consider not posting proposed solutions; certainly not in isolation. Please post problems, and background. If you should post a question on a particular solution, then you'll usually get an answer to that approach. Here's the rub with asking specific questions: the specific answer you'll (usually) get means you might (will?) miss alternative (better) solutions to your actual problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2010 07:54 AM
10-07-2010 07:54 AM
Re: Is close() required after using socket_fd()
Thanks for all the useful comments, and the others as well. I'll write a test program which creates several sockets off a vms channel to see what happens when I close them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2010 08:56 AM
10-07-2010 08:56 AM
Re: Is close() required after using socket_fd()
On one of the other platforms I deal with, that same support is six or eight button-presses and some simple (provided) input forms to get the keys set-up, and probably ten lines of code.
I feel your pain.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2010 04:25 PM
10-07-2010 04:25 PM
Re: Is close() required after using socket_fd()
One port for in the clear access and another for SSL?
Cheers Richard Maher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2010 02:54 PM
10-08-2010 02:54 PM
Re: Is close() required after using socket_fd()
The OpenSSL library lets you supply your own BIO (buffered I/O) object for providing the communication stream that the SSL protocol runs over. That's how the OSU web server supports SSL using $QIO interfaces to the TCP/IP stack.