97 lines
6.2 KiB
HTML
97 lines
6.2 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<!DOCTYPE html
|
||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<html lang="en-us" xml:lang="en-us">
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
<meta name="security" content="public" />
|
||
<meta name="Robots" content="index,follow" />
|
||
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
<meta name="DC.Type" content="reference" />
|
||
<meta name="DC.Title" content="Socket scenario: Create an application to accept IPv4 and IPv6 clients" />
|
||
<meta name="abstract" content="This topic describes a typical situation in which you might want to use the AF_INET6 address family." />
|
||
<meta name="description" content="This topic describes a typical situation in which you might want to use the AF_INET6 address family." />
|
||
<meta name="DC.Relation" scheme="URI" content="rzab6soxoverview.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="xacceptboth.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="xip6client.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="uafinet6.htm" />
|
||
<meta name="DC.Relation" scheme="URI" content="uafinet6.htm" />
|
||
<meta name="copyright" content="(C) Copyright IBM Corporation 2001, 2006" />
|
||
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2001, 2006" />
|
||
<meta name="DC.Format" content="XHTML" />
|
||
<meta name="DC.Identifier" content="ip6scen" />
|
||
<meta name="DC.Language" content="en-us" />
|
||
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
<!-- US Government Users Restricted Rights -->
|
||
<!-- Use, duplication or disclosure restricted by -->
|
||
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
<title>Socket scenario: Create an application to accept IPv4 and IPv6 clients</title>
|
||
</head>
|
||
<body id="ip6scen"><a name="ip6scen"><!-- --></a>
|
||
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
<h1 class="topictitle1">Socket scenario: Create an application to accept IPv4 and IPv6 clients</h1>
|
||
<div><p>This topic describes a typical situation in which you might want
|
||
to use the AF_INET6 address family.</p>
|
||
<div class="section"><h4 class="sectiontitle">Situation</h4><p>Suppose you are a socket programmer that
|
||
works for an application development company that specializes in socket applications
|
||
for iSeries™.
|
||
To keep ahead of their competitors, you have decided to develop a suite of
|
||
applications that use the AF_INET6 address family, which accept connections
|
||
from IPv4 and IPv6. You want to create an application that processes requests
|
||
from both IPv4 and IPv6 nodes. You know that the i5/OS™ supports the AF_INET6 address family
|
||
sockets which provides interoperability with AF_INET address family sockets.
|
||
You also know this can be accomplished by using an IPv4-mapped IPv6 address
|
||
format. </p>
|
||
</div>
|
||
<div class="section"><h4 class="sectiontitle">Scenario objectives</h4><p>This scenario has the following
|
||
objectives and goals:</p>
|
||
<ol><li>Create a server application that accepts and processes requests
|
||
from IPv6 and IPv4 clients</li>
|
||
<li>Create a client application that requests data from an IPv4 or IPv6 server
|
||
application</li>
|
||
</ol>
|
||
</div>
|
||
<div class="section"><h4 class="sectiontitle">Prerequisite steps</h4><p>Before developing your application
|
||
that meets these objectives, complete the following tasks:</p>
|
||
<ol><li>Install QSYSINC library. This library provides necessary header files
|
||
that are needed when compiling socket applications.</li>
|
||
<li>Install the C Compiler licensed program (5722–CX2).</li>
|
||
<li>Install and configure an Ethernet card. For information
|
||
about Ethernet options, see the <a href="../rzajy/rzajyoverview.htm">Ethernet</a> topic in the information center.</li>
|
||
<li> <p><a href="../rzai2/rzai2firsttime.htm">Set
|
||
up TCP/IP</a> and <a href="../rzai2/rzai2configipv6.htm">IPv6 </a> network.</p>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
<div class="section"><h4 class="sectiontitle">Scenario details</h4><p>The following graphic describes
|
||
the IPv6 network for which you create applications to handle requests from
|
||
IPv6 and IPv4 clients. The iSeries contains the program that listens and processes
|
||
requests from these clients. The network is comprised of two separate domains,
|
||
one that contains IPv4 clients exclusively and the other remote network containing
|
||
only IPv6 clients. The domain name of the iSeries is myserver.myco.com. The server
|
||
application uses the AF_INET6 address family to process these incoming requests
|
||
with the in6addr_any specified on the <span class="apiname">bind()</span> function
|
||
call.</p>
|
||
</div>
|
||
<div class="section"><p><br /><img src="rzab6510.gif" alt="Network diagram shows a IPv6 network connected to a IPv4 network" /><br /></p>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<ul class="ullinks">
|
||
<li class="ulchildlink"><strong><a href="xacceptboth.htm">Example: Accept connections from both IPv6 and IPv4 clients</a></strong><br />
|
||
Use this sample program to create a server/client model that accepts requests from both IPv4 (those socket applications that use the AF_INET address family) and IPv6 (those applications that use the AF_INET6 address family).</li>
|
||
<li class="ulchildlink"><strong><a href="xip6client.htm">Example: IPv4 or IPv6 client</a></strong><br />
|
||
This sample program can be used with the server application that accepts requests from either IPv4 or IPv6 clients.</li>
|
||
</ul>
|
||
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzab6soxoverview.htm" title="A socket is a communications connection point (endpoint) that you can name and address in a network.">Socket programming</a></div>
|
||
</div>
|
||
<div class="relref"><strong>Related reference</strong><br />
|
||
<div><a href="uafinet6.htm" title="AF_INET6 sockets provide support for Internet Protocol version 6 (IPv6) 128 bit (16 byte) address structures. Programmers can write applications using AF_INET6 address family to accept client requests for either IPv4 or IPv6 nodes or from IPv6 nodes only.">Use AF_INET6 address family</a></div>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html> |