× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I assume you mean using the Unix-type APIs. (I'm not aware of any way to do socket programming with the C run-time -- and I thought I was pretty good at sockets!)

I've written the prototypes/constants/structures for IPv6 into my SOCKET_H member. You can get them here:

http://www.scottklement.com/rpg/copybooks/socket_h.rpgle.txt

Unfortunately, at this point, they're all untested. I don't currently have access to an IPv6 network, so I have no way to test my code.

Here are a few salient points:

1) You should replace inet_addr(), gethostbyname() and getservbyname(), gethostbyaddr() with a calls to getaddrinfo() and getnameinfo(). (This will work with IPv4 as well... but does require v5r2.

2) For IPv6, you'll want to use AF_INET6 and IPPROTO_IPV6 instead of AF_INET and IPPROTO_IP when calling the socket() API.

3) Use structure sockaddr_in6 in place of sockaddr_in when calling connect(), bind(), or accept().

4) recv(), send(), close() should work the same as before.

5) You must call freeaddrinfo() to free up memory used by getaddrinfo().

Good luck


On 11/15/2010 5:45 PM, DeLong, Eric wrote:
I've been looking at documentation relating to IPv6, and realize that
any sockets applications that I've written will need to be modified to
work with IPv6 addressing. Has anyone gone through this, and could
offer any tips or sample code? I am just wanting to be prepared for
this for when we're forced to switch. I sometimes wonder if I'm
misunderstanding this whole IPv6 issue, since I don't see anyone here
who seem to be coding for it. Am I jumping to unwarranted conclusions,
or will this transition to IPv6 be another bloody mess?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.