- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- getpeername API()
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
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
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
тАО02-07-2006 05:08 PM
тАО02-07-2006 05:08 PM
getpeername API()
The API returns with return code zero, however does not fill in the struct addr or value of length.
Is this an expected behavior by the API, else, what could I suspect?
The other APIs like getsockname() etc return correct value just before this call. So if their is a issue with the peer socket, it would report it, right?
I am setting the length to the struct sockaddr before calling the API, which is reset to zero post call.
Any pointers/ link to known issues/ patches required will be of help.
Thanks,
Shweta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 05:29 PM
тАО02-07-2006 05:29 PM
Re: getpeername API()
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 06:32 PM
тАО02-07-2006 06:32 PM
Re: getpeername API()
Hope you are using HP-UX. Take a look at this links, it may help you if you are transisting your apps from Solaris to HP-UX or Linux to HP-UX.
http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?debug=0&manpage=/usr/share/man/man2.Z/getpeername.2
http://devrsrc1.external.hp.com/STKL/impacts/i38.html
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 08:09 PM
тАО02-07-2006 08:09 PM
Re: getpeername API()
Yes I am running this on a HP-UX B.11.11 U 9000/800
I did go though the manual page, however didn't catch anything in particular.
Using a simple socket program, the API does return having filled in the addr structure properly. However not in my application, I am not sure what to suspect.
I tried both the combinations
a)
struct sockaddr and sizeof(struct sockaddr)
b)
struct sockaddr_un and sizeof(struct sockaddr_un)
Anything more I may provide?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 08:15 PM
тАО02-07-2006 08:15 PM
Re: getpeername API()
It could be due to incompatible types, if possible attach your sample code to take a look at it.
-Arun
P.S Assign points.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2006 12:50 PM
тАО02-08-2006 12:50 PM
Re: getpeername API()
Have you looked at your application's getpeername() call in a verbose tusc trace (tusc -v)?
BTW, unless you are completely disassociated from the code that made the accept() call, you should already have the peer information from what is returned by the accept() call (or for that matter from what you passed-in to a connect() call)
Also, you might check what sizeof(struct sockaddr) happens to be comapred with sizeof (struct sockaddr_in) if this is an IPv4 application or struct sockaddr_in6 if this is IPv6...