<?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="Use AF_INET address family" /> <meta name="abstract" content="AF_INET address family sockets can be either connection-oriented (type SOCK_STREAM) or they can be connectionless (type SOCK_DGRAM)." /> <meta name="description" content="AF_INET address family sockets can be either connection-oriented (type SOCK_STREAM) or they can be connectionless (type SOCK_DGRAM)." /> <meta name="DC.Relation" scheme="URI" content="uaddrfam.htm" /> <meta name="DC.Relation" scheme="URI" content="cafinet.htm" /> <meta name="DC.Relation" scheme="URI" content="prerequisites.htm" /> <meta name="DC.Relation" scheme="URI" content="xconoserver.htm" /> <meta name="DC.Relation" scheme="URI" content="xconoclient.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="uafinet" /> <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>Use AF_INET address family</title> </head> <body id="uafinet"><a name="uafinet"><!-- --></a> <!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script> <h1 class="topictitle1">Use AF_INET address family</h1> <div><p>AF_INET address family sockets can be either connection-oriented (type SOCK_STREAM) or they can be connectionless (type SOCK_DGRAM).</p> <div class="section"><p>Connection-oriented AF_INET sockets use TCP as the transport protocol. Connectionless AF_INET sockets use User Datagram Protocol (UDP) as the transport protocol. When you create an AF_INET domain socket, you specify AF_INET for the address family in the socket program. AF_INET sockets can also use a type of SOCK_RAW. If this type is set, the application connects directly to the IP layer and does not use either the TCP or UDP transports.</p> </div> </div> <div> <div class="familylinks"> <div class="parentlink"><strong>Parent topic:</strong> <a href="uaddrfam.htm" title="This topic includes sample programs that illustrate each of the socket address families.">Design applications with address families</a></div> </div> <div class="relref"><strong>Related reference</strong><br /> <div><a href="cafinet.htm" title="This address family provides interprocess communications between processes that run on the same system or on different systems.">AF_INET address family</a></div> <div><a href="prerequisites.htm" title="Before writing socket applications, you must first complete these steps.">Prerequisites for socket programming</a></div> <div><a href="xconoserver.htm" title="This code example shows how a connection-oriented server can be created.">Example: A connection-oriented server</a></div> <div><a href="xconoclient.htm" title="This example shows how to create a socket client program to connect to a connection-oriented server in a connection-oriented design.">Example: A connection-oriented client</a></div> </div> </div> </body> </html>