335:
2583:
protocol with no guarantee of delivery. UDP packets may arrive out of order, multiple times, or not at all. Because of this minimal design, UDP has considerably less overhead than TCP. Being connectionless means that there is no concept of a stream or permanent connection between two hosts. Such data
879:
These functions are not strictly a component of the BSD socket API, but are often used in conjunction with the API functions for looking up a host. These functions are now considered legacy interfaces for querying the domain name system. New functions that are completely protocol-agnostic (supporting
1171:
The original design concept of the socket interface distinguished between protocol types (families) and the specific address types that each may use. It was envisioned that a protocol family may have several address types. Address types were defined by additional symbolic constants, using the prefix
1245:
A blocking socket does not return control until it has sent (or received) some or all data specified for the operation. It is normal for a blocking socket not to send all data. The application must check the return value to determine how many bytes have been sent or received and it must resend any
893:
This pair of functions appeared at the same time as the BSD socket API proper in 4.2BSD (1983), the same year DNS was first created. Early versions did not query DNS and only performed /etc/hosts lookup. The 4.3BSD (1984) version added DNS in a crude way. The current implementation using
1184:-identifiers are intended for all data structures that specifically deal with the address type and not the protocol family. However, this concept of separation of protocol and address type has not found implementation support and the
800:
fails (as it is specified in the Single Unix
Specification), thus, portable applications should close the socket descriptor immediately and obtain a new descriptor with socket(), in the case the call to connect() fails.
1246:
data not already processed. When using blocking sockets, special consideration should be given to accept() as it may still block after indicating readability if a client disconnects during the connection phase.
373:
is used on the server side. It accepts a received incoming attempt to create a new TCP connection from the remote client, and creates a new socket associated with the socket address pair of this connection.
612:, it is only given a protocol family, but not assigned an address. This association must be performed before the socket can accept connections from other hosts. The function has three arguments:
1375:). This blocks the process until an incoming connection is received, and returns a socket descriptor for the accepted connection. The initial descriptor remains a listening descriptor, and
172:
As the
Berkeley socket API evolved and ultimately yielded the POSIX socket API, certain functions were deprecated or removed and replaced by others. The POSIX API is also designed to be
1249:
A non-blocking socket returns whatever is in the receive buffer and immediately continues. If not written correctly, programs using non-blocking sockets are particularly susceptible to
1279:
When an application closes a socket, only the interface to the socket is destroyed. It is the kernel's responsibility to destroy the socket internally. Sometimes, a socket may enter a
910:
The
Berkeley socket API is a general interface for networking and interprocess communication, and supports the use of various network protocols and address architectures.
274:
The
Berkeley socket interface is defined in several header files. The names and content of these files differ slightly between implementations. In general, they include:
299:
AF_INET and AF_INET6 address families and their corresponding protocol families, PF_INET and PF_INET6. These include standard IP addresses and TCP and UDP port numbers.
59:
437:
is used to check on the state of a socket in a set of sockets. The set can be tested to see if any socket can be written to, read from or if an error occurred.
1314:
protocol that provides a variety of error correction and performance features for transmission of byte streams. A process creates a TCP socket by calling the
367:
is used on the client side, and assigns a free local port number to a socket. In case of a TCP socket, it causes an attempt to establish a new TCP connection.
4187:
687:, an integer representing the number of pending connections that can be queued up at any one time. The operating system usually places a cap on this value.
2603:
An application may set up a UDP server on port number 7654 as follows. The programs contains an infinite loop that receives UDP datagrams with function
662:
prepares it for incoming connections. However, this is only necessary for the stream-oriented (connection-oriented) data modes, i.e., for socket types (
145:
All modern operating systems implement a version of the
Berkeley socket interface. It became the standard interface for applications running in the
355:
is typically used on the server side, and associates a socket with a socket address structure, i.e. a specified local IP address and a port number.
4192:
759:
establishes a direct communication link to a specific remote host identified by its address via a socket, identified by its file descriptor.
748:
Datagram sockets do not require processing by accept() since the receiver may immediately respond to the request using the listening socket.
707:. It creates a new socket for each connection and removes the connection from the listening queue. The function has the following arguments:
4046:
3246:
The following is a client program for sending a UDP packet containing the string "Hello World!" to address 127.0.0.1 at port number 7654.
1272:
The operating system does not release the resources allocated to a socket until the socket is closed. This is especially important if the
1218:
provide a simple interface that bypasses the processing by the host's TCP/IP stack. They permit implementation of networking protocols in
4025:
4114:
4047:"ntua.gr - Programming UNIX Sockets in C - Frequently Asked Questions: Questions regarding both Clients and Servers (TCP/SOCK_STREAM)"
135:
1311:
1223:
763:
39:
431:
is used to suspend, waiting for one or more of a provided list of sockets to be ready to read, ready to write, or that have errors.
4154:
4148:
3959:
Volume 1, Third
Edition: The Sockets Networking API, W. Richard Stevens, Bill Fenner, Andrew M. Rudoff, Addison Wesley, 2003.
1196:
constants as a technical argument of no practical consequence. Indeed, much confusion exists in the proper usage of both forms.
323:
Functions for translating protocol names and host names into numeric addresses. Searches local data as well as name services.
255:(TLI) API offers an alternative to the socket API. Many systems that provide the TLI API also provide the Berkeley socket API.
116:
33:
1307:
558:
3822:
1143:
1054:
796:
represents an error. Historically, in BSD-derived systems, the state of a socket descriptor is undefined if the call to
913:
The following lists a sampling of protocol families (preceded by the standard symbolic identifier) defined in a modern
4106:
3772:
699:
When an application is listening for stream-oriented connections from other hosts, it is notified of such events (cf.
51:
821:
or the local host's other resolver mechanisms (e.g., /etc/hosts lookup). They return a pointer to an object of type
948:
902:, NSS makes DNS only one of the many options for lookup by these functions and its use can be disabled even today.
3990:
307:
PF_UNIX and PF_LOCAL address family. Used for local communication between programs running on the same computer.
252:
248:
157:
691:
Once a connection is accepted, it is dequeued. On success, 0 is returned. If an error occurs, -1 is returned.
349:
creates a new socket of a certain type, identified by an integer number, and allocates system resources to it.
3969:
4182:
978:
872:
may be checked to see whether this is a temporary failure or an invalid or unknown host. Otherwise a valid
405:
causes the system to release resources allocated to a socket. In case of TCP, the connection is terminated.
258:
Non-Unix systems often expose the
Berkeley socket API with a translation layer to a native networking API.
3518:/* IPv4 addresses is a uint32_t, convert a string representation of the octets to the appropriate value */
2576:
767:
570:
173:
43:
3787:
766:
protocol, this establishes a connection. Certain types of protocols are connectionless, most notably the
3900:
3858:
1000:
259:
3922:
138:
release versions of the operating system and networking library free from the licensing constraints of
3775:
73:) for the local endpoint of a network communication path. The Berkeley sockets API represents it as a
1239:
338:
Flow diagram of client-server transaction using sockets with the
Transmission Control Protocol (TCP).
3551:/* sockets are unsigned shorts, htons(x) ensures x is in network byte order, set the port to 7654 */
895:
745:
if an error occurs. All further communication with the remote host now occurs via this new socket.
597:
if an error occurred. Otherwise, it returns an integer representing the newly assigned descriptor.
496:
334:
139:
55:
1188:-constants were defined by the corresponding protocol identifier, leaving the distinction between
4077:
Std. 1003.1-2001 Standard for
Information Technology—Portable Operating System Interface (POSIX).
3881:
818:
774:
defines the remote address for sending and receiving data, allowing the use of functions such as
153:
implementation for MS Windows, created by unaffiliated developers, closely follows the standard.
70:
47:
4110:
3930:
1364:
Preparing the socket to listen for connections (making it a listening socket), with a call to
826:
93:
443:
is used to retrieve the current value of a particular socket option for the specified socket.
131:
86:
4070:
standard definition of the
Sockets interface is contained in the POSIX standard, known as:
1222:
and aid in debugging of the protocol stack. Raw sockets are used by some services, such as
782:. In these cases, the connect function prevents reception of datagrams from other sources.
3943:
2585:
730:
location that specifies the size of the client address structure passed to accept(). When
532:
463:
161:
82:
74:
4137:
866:
The functions return a NULL pointer in case of error, in which case the external integer
2580:
1250:
1227:
66:
3808:
160:. Most other programming languages provide similar interfaces, typically written as a
4176:
4165:
1328:
700:
522:
4094:
The IPv6 extensions to the base socket API are documented in RFC 3493 and RFC 3542.
361:
is used on the server side, and causes a bound TCP socket to enter listening state.
134:, released in 1983, as a programming interface. Not until 1989, however, could the
1298:
or SO_LINGER may be required on these systems to guarantee delivery of all data.
720:, a pointer to a sockaddr structure to receive the client's address information.
881:
234:
221:
78:
1256:
A socket is typically set to blocking or non-blocking mode using the functions
1219:
1215:
17:
4160:
988:
938:
741:
returns the new socket descriptor for the accepted connection, or the value
4080:
Open Group Technical Standard: Base Specifications, Issue 6, December 2001.
2123:
set to the IP address of the listening server (also in network byte order).
589:
may be used to select a default protocol from the selected domain and type.
2591:
UDP address space, the space of UDP port numbers (in ISO terminology, the
1408:
The following program creates a TCP server listening on port number 1100:
475:, which specifies the protocol family of the created socket. For example:
4087:
Information about this standard and ongoing work on it is available from
3910:
3868:
886:
146:
4100:
714:, the descriptor of the listening socket that has the connection queued.
4066:
3906:
3864:
2119:
set to the port the endpoint is listening (in network byte order), and
1321:
150:
862:
specifies the address family type (e.g., AF_INET) of the host address.
734:
returns, this location contains the size (in bytes) of the structure.
266:
use file-system APIs with control files rather than file-descriptors.
1379:
can be called again at any time with this socket, until it is closed.
1023:
1011:
557:
specifying the actual transport protocol to use. The most common are
263:
3923:
https://manpages.debian.org/experimental/ax25-tools/netrom.4.en.html
342:
The Berkeley socket API typically provides the following functions:
4088:
2092:
Programming a TCP client application involves the following steps:
899:
898:
derives Solaris and later NetBSD 1.4 (1999). Initially defined for
608:
associates a socket with an address. When a socket is created with
449:
is used to set a particular socket option for the specified socket.
1261:
1257:
1131:
968:
914:
333:
100:
4074:
2592:
1287:
1064:
1043:
1033:
576:
564:
492:
482:
391:
are used for sending and receiving data. The standard functions
128:
4142:
4004:
1347:
Establishing a TCP server involves the following basic steps:
918:
2145:
Closing each socket that was opened after use with function
1401:
Closing each socket that was opened after use with function
703:
function) and must initialize the connection using function
218:
gethostbyname, gethostbyaddr, getservbyname, getservbyport
4155:
Programming UNIX Sockets in C - Frequently Asked Questions
2126:
Communicating with the remote host with the API functions
1382:
Communicating with the remote host with the API functions
425:
are used to resolve host names and addresses. IPv4, IPv6.
92:
Berkeley sockets evolved with little modification from a
85:
that provides a common interface for input and output to
415:
are used to resolve host names and addresses. IPv4 only.
4099:
Stevens, W. Richard; Rago, Stephen A. (May 24, 2013).
1318:
function with the parameters for the protocol family (
4138:
UNIX Programmer's Supplementary Documents (PSD: 20-1)
1164:
function, by specifying the desired protocol family (
959:
Asynchronous Transfer Mode Switched Virtual Circuits
3380:/* create an Internet, datagram, socket using UDP */
817:
are used to resolve host names and addresses in the
658:
After a socket has been associated with an address,
462:
creates an endpoint for communication and returns a
2120:
2116:
2108:
2104:
1315:
1295:
1291:
1199:The POSIX.1—2008 specification doesn't specify any
1161:
2595:), is completely disjoint from that of TCP ports.
1238:Berkeley sockets can operate in one of two modes:
829:host. The functions use the following arguments:
505:for local socket (using a special filesystem node)
880:IPv6) have been defined. These new functions are
315:Functions for manipulating numeric IP addresses.
2134:, as well as with the general-purpose functions
1390:, as well as with the general-purpose functions
1283:state, on the server side, for up to 4 minutes.
1160:A socket for communications is created with the
788:returns an integer representing the error code:
650:returns 0 on success and -1 if an error occurs.
115:, acknowledging the first implementation in the
204:Conversion from packed address to text address
193:Conversion from text address to packed address
629:structure representing the address to bind to.
62:operating system, which was released in 1983.
8:
4102:Advanced Programming in the UNIX Environment
3970:"The Open Group Base Specifications Issue 7"
127:Berkeley sockets originated with the 4.2BSD
58:of linkable modules. It originated with the
4149:Porting Berkeley Socket programs to Winsock
3835:
1335:), and the IP protocol identifier for TCP (
770:. When used with connectionless protocols,
291:Core socket functions and data structures.
3434:/* if socket failed to initialize, exit */
1357:Binding the socket to the listening port (
923:
3751:is a pointer to the data to be sent, and
1091:Amateur radio NET/ROM (related to AX.25)
466:for the socket. It uses three arguments:
3809:"The Organization of Networks in Plan 9"
1253:due to variances in network link speed.
581:. These protocols are specified in file
276:
178:
3764:
2541:/* perform read write operations ... */
54:(IPC). It is commonly implemented as a
3939:
3928:
1083:Local to host (pipes and file-domain)
619:, a descriptor representing the socket
547:(raw protocols atop the network layer)
156:The BSD sockets API is written in the
4005:"Beej's Guide to Network Programming"
1950:/* perform read write operations ...
1351:Creating a TCP socket with a call to
521:(reliable stream-oriented service or
228:Reverse lookup for host name/service
215:Forward lookup for host name/service
7:
4143:Beej's Guide to Network Programming
852:specifies the length, in bytes, of
846:containing the address of the host.
541:(reliable sequenced packet service)
4188:Application programming interfaces
3880:Conill, Ariadne (March 27, 2022).
3823:"Linux TCP/IP stack as VFS plugin"
136:University of California, Berkeley
25:
3991:"TCP/IP raw sockets - Win32 apps"
3443:"Error Creating Socket"
40:application programming interface
3755:specifies the size of the data.
2307:"cannot create socket"
1551:"cannot create socket"
1371:Accepting incoming connections (
1361:) after setting the port number.
1276:call fails and will be retried.
2571:Client-server example using UDP
1302:Client-server example using TCP
882:getaddrinfo() and getnameinfo()
836:specifies the name of the host.
805:gethostbyname and gethostbyaddr
107:is essentially synonymous with
69:is an abstract representation (
27:Inter-process communication API
4193:Berkeley Software Distribution
3882:"the tragedy of gethostbyname"
3788:"— POSIX.1-2008 specification"
3679:"Error sending packet: %s
2584:are referred to as datagrams (
1234:Blocking and non-blocking mode
1099:Reserved for 802.2LLC project
117:Berkeley Software Distribution
1:
3464:/* Zero out socket address */
2949:"error bind failed"
2654:/* for close() for socket */
1308:Transmission Control Protocol
1294:may discard data. The use of
1168:-identifier) as an argument.
906:Protocol and address families
231:gethostbyaddr, getservbyport
111:, but they are also known as
4151:- Microsoft's documentation.
1154:Sangoma Wanpipe API sockets
1144:Systems Network Architecture
1107:Security callback pseudo AF
1055:Internetwork Packet Exchange
681:, a valid socket descriptor.
4107:Addison-Wesley Professional
2001:"shutdown failed"
1953:read(ConnectFD, buff, size)
1044:Internet Protocol version 6
1034:Internet Protocol version 4
951:Permanent Virtual Circuits
639:specifying the size of the
123:History and implementations
52:inter-process communication
4209:
2508:"connect failed"
2099:Connecting to the server (
1080:PF_LOCAL, PF_UNIX, PF_FILE
1075:PF_KEY key management API
949:Asynchronous Transfer Mode
792:represents success, while
4161:Linux network programming
3773:Ruby programming language
3497:/* The address is IPv4 */
3200:"datagram: %.*s
1917:"accept failed"
1815:"listen failed"
884:, and are based on a new
842:specifies a pointer to a
253:Transport Layer Interface
3957:UNIX Network Programming
3374:"hello world!"
3248:
2609:
2151:
1410:
674:requires two arguments:
103:specification. The term
99:into a component of the
3836:Stevens & Rago 2013
2418:"192.168.1.3"
1740:"bind failed"
1327:), the socket mode for
1123:Packet capture sockets
979:Controller Area Network
44:Internet domain sockets
3730:/* close the socket */
2577:User Datagram Protocol
2096:Creating a TCP socket.
1226:, that operate at the
768:User Datagram Protocol
339:
158:C programming language
4026:"terminating sockets"
4007:. Beej.us. 2007-05-05
3545:"127.0.0.1"
1230:of the TCP/IP model.
1203:-constants, but only
825:, which describes an
593:The function returns
531:(datagram service or
481:for network protocol
337:
168:BSD and POSIX sockets
142:'s proprietary Unix.
3972:. Pubs.opengroup.org
3290:<netinet/in.h>
3278:<sys/socket.h>
2645:<netinet/in.h>
2633:<sys/socket.h>
2169:<netinet/in.h>
2163:<sys/socket.h>
1428:<netinet/in.h>
1422:<sys/socket.h>
1112:PF_NETLINK, PF_ROUTE
495:(and in some cases,
330:Socket API functions
164:based on the C API.
140:AT&T Corporation
3302:<arpa/inet.h>
3284:<sys/types.h>
2639:<sys/types.h>
2175:<arpa/inet.h>
2157:<sys/types.h>
2107:structure with the
1434:<arpa/inet.h>
1416:<sys/types.h>
1312:connection-oriented
1268:Terminating sockets
896:Name Service Switch
764:connection-oriented
497:backward compatible
176:and supports IPv6.
48:Unix domain sockets
4105:(Third ed.).
4089:the Austin website
3993:. 19 January 2022.
3867:Library Functions
819:domain name system
635:, a field of type
340:
4083:ISO/IEC 9945:2002
4049:. Softlab.ntua.gr
4028:. Softlab.ntua.gr
3938:Missing or empty
3155:"recsize: %d
1242:or non-blocking.
1158:
1157:
827:Internet Protocol
726:, a pointer to a
625:, a pointer to a
399:may also be used.
327:
326:
240:
239:
16:(Redirected from
4200:
4127:
4125:
4123:
4058:
4057:
4055:
4054:
4043:
4037:
4036:
4034:
4033:
4022:
4016:
4015:
4013:
4012:
4001:
3995:
3994:
3987:
3981:
3980:
3978:
3977:
3966:
3960:
3954:
3948:
3947:
3941:
3936:
3934:
3926:
3919:
3913:
3904:
3903:
3901:nsswitch.conf(5)
3896:
3890:
3889:
3877:
3871:
3862:
3861:
3859:gethostbyname(3)
3854:
3848:
3845:
3839:
3833:
3827:
3826:
3819:
3813:
3812:
3805:
3799:
3798:
3796:
3795:
3784:
3778:
3776:ruby-doc::Socket
3769:
3743:
3740:
3737:
3734:
3731:
3728:
3725:
3722:
3719:
3716:
3713:
3710:
3707:
3704:
3701:
3698:
3695:
3692:
3689:
3686:
3683:
3680:
3677:
3674:
3671:
3668:
3665:
3662:
3659:
3656:
3653:
3650:
3649:
3646:
3643:
3640:
3637:
3634:
3631:
3628:
3625:
3622:
3619:
3616:
3613:
3610:
3607:
3604:
3601:
3598:
3595:
3592:
3589:
3586:
3583:
3580:
3576:
3573:
3570:
3567:
3564:
3561:
3558:
3555:
3552:
3549:
3546:
3543:
3540:
3537:
3534:
3531:
3528:
3525:
3522:
3519:
3516:
3513:
3510:
3507:
3504:
3501:
3498:
3495:
3492:
3489:
3486:
3483:
3480:
3477:
3474:
3471:
3468:
3465:
3462:
3459:
3456:
3453:
3450:
3447:
3444:
3441:
3438:
3435:
3432:
3429:
3426:
3423:
3420:
3417:
3414:
3411:
3408:
3405:
3402:
3399:
3396:
3393:
3390:
3387:
3384:
3381:
3378:
3375:
3372:
3369:
3366:
3363:
3360:
3357:
3354:
3351:
3348:
3345:
3342:
3339:
3336:
3333:
3330:
3327:
3324:
3321:
3318:
3315:
3312:
3309:
3306:
3303:
3300:
3297:
3296:<unistd.h>
3294:
3291:
3288:
3285:
3282:
3279:
3276:
3273:
3272:<string.h>
3270:
3267:
3264:
3261:
3258:
3255:
3254:<stdlib.h>
3252:
3237:
3234:
3231:
3228:
3225:
3222:
3219:
3216:
3213:
3210:
3207:
3204:
3201:
3198:
3195:
3192:
3189:
3186:
3183:
3180:
3177:
3174:
3171:
3168:
3165:
3162:
3159:
3156:
3153:
3150:
3147:
3144:
3141:
3138:
3135:
3132:
3129:
3126:
3123:
3120:
3117:
3114:
3111:
3108:
3105:
3102:
3099:
3096:
3093:
3090:
3087:
3084:
3081:
3078:
3075:
3074:
3071:
3068:
3065:
3062:
3059:
3056:
3053:
3050:
3047:
3044:
3041:
3038:
3035:
3032:
3029:
3026:
3023:
3020:
3017:
3014:
3011:
3008:
3005:
3002:
2999:
2996:
2993:
2989:
2986:
2983:
2980:
2977:
2974:
2971:
2968:
2965:
2962:
2959:
2956:
2953:
2950:
2947:
2944:
2941:
2940:
2937:
2934:
2931:
2928:
2925:
2922:
2919:
2916:
2913:
2910:
2907:
2904:
2901:
2898:
2895:
2892:
2889:
2886:
2883:
2880:
2876:
2875:
2872:
2869:
2866:
2863:
2860:
2857:
2854:
2851:
2848:
2844:
2841:
2838:
2835:
2832:
2829:
2826:
2823:
2820:
2817:
2814:
2811:
2808:
2805:
2802:
2799:
2796:
2793:
2790:
2787:
2784:
2781:
2778:
2775:
2772:
2769:
2766:
2763:
2760:
2757:
2754:
2751:
2748:
2745:
2742:
2739:
2736:
2733:
2730:
2727:
2724:
2721:
2718:
2715:
2712:
2709:
2706:
2703:
2700:
2697:
2694:
2691:
2688:
2685:
2682:
2679:
2676:
2673:
2670:
2667:
2664:
2661:
2660:<stdlib.h>
2658:
2655:
2652:
2651:<unistd.h>
2649:
2646:
2643:
2640:
2637:
2634:
2631:
2628:
2627:<string.h>
2625:
2622:
2619:
2616:
2613:
2586:datagram sockets
2566:
2563:
2560:
2557:
2554:
2551:
2548:
2545:
2542:
2539:
2536:
2533:
2530:
2527:
2524:
2521:
2518:
2515:
2512:
2509:
2506:
2503:
2500:
2497:
2494:
2491:
2488:
2485:
2482:
2479:
2476:
2473:
2470:
2467:
2464:
2461:
2458:
2455:
2452:
2449:
2446:
2443:
2440:
2437:
2434:
2431:
2428:
2425:
2422:
2419:
2416:
2413:
2410:
2407:
2404:
2401:
2398:
2395:
2392:
2389:
2386:
2383:
2380:
2377:
2374:
2371:
2368:
2365:
2362:
2359:
2356:
2353:
2350:
2347:
2344:
2341:
2338:
2335:
2332:
2329:
2326:
2323:
2320:
2317:
2314:
2311:
2308:
2305:
2302:
2299:
2296:
2293:
2290:
2287:
2284:
2281:
2278:
2275:
2272:
2269:
2266:
2263:
2260:
2257:
2254:
2251:
2248:
2245:
2242:
2239:
2236:
2233:
2230:
2227:
2224:
2221:
2218:
2215:
2212:
2209:
2206:
2203:
2200:
2199:<unistd.h>
2197:
2194:
2193:<string.h>
2191:
2188:
2187:<stdlib.h>
2185:
2182:
2179:
2176:
2173:
2170:
2167:
2164:
2161:
2158:
2155:
2122:
2118:
2114:
2110:
2106:
2103:), by passing a
2083:
2080:
2077:
2074:
2071:
2068:
2065:
2062:
2059:
2056:
2053:
2050:
2047:
2044:
2041:
2038:
2035:
2032:
2029:
2026:
2023:
2020:
2017:
2014:
2011:
2008:
2005:
2002:
1999:
1996:
1993:
1990:
1987:
1984:
1981:
1978:
1975:
1972:
1969:
1966:
1963:
1960:
1957:
1954:
1951:
1948:
1945:
1942:
1939:
1936:
1933:
1930:
1927:
1924:
1921:
1918:
1915:
1912:
1909:
1906:
1903:
1900:
1897:
1894:
1891:
1888:
1885:
1882:
1879:
1876:
1873:
1870:
1867:
1864:
1861:
1858:
1855:
1852:
1849:
1846:
1843:
1840:
1837:
1834:
1831:
1828:
1825:
1822:
1819:
1816:
1813:
1810:
1807:
1804:
1801:
1798:
1795:
1792:
1789:
1786:
1783:
1780:
1777:
1774:
1771:
1768:
1765:
1762:
1759:
1756:
1753:
1750:
1747:
1744:
1741:
1738:
1735:
1732:
1729:
1726:
1723:
1720:
1717:
1714:
1711:
1708:
1705:
1702:
1699:
1696:
1693:
1690:
1687:
1684:
1681:
1678:
1675:
1672:
1669:
1666:
1663:
1660:
1657:
1654:
1651:
1648:
1645:
1642:
1639:
1636:
1633:
1630:
1627:
1624:
1621:
1618:
1615:
1612:
1609:
1606:
1603:
1600:
1597:
1594:
1591:
1588:
1585:
1582:
1579:
1576:
1573:
1570:
1567:
1564:
1561:
1558:
1555:
1552:
1549:
1546:
1543:
1540:
1537:
1534:
1531:
1528:
1525:
1522:
1519:
1516:
1513:
1510:
1507:
1504:
1501:
1498:
1495:
1492:
1489:
1486:
1483:
1480:
1477:
1474:
1471:
1468:
1465:
1462:
1459:
1458:<unistd.h>
1456:
1453:
1452:<string.h>
1450:
1447:
1446:<stdlib.h>
1444:
1441:
1438:
1435:
1432:
1429:
1426:
1423:
1420:
1417:
1414:
1338:
1334:
1326:
1317:
1297:
1293:
1282:
1206:
1202:
1195:
1191:
1187:
1183:
1179:
1175:
1167:
1163:
930:Function or use
924:
921:implementation:
890:data structure.
874:struct hostent *
871:
596:
588:
579:
573:
567:
561:
556:
546:
540:
533:datagram sockets
530:
520:
514:
504:
490:
480:
474:
277:
179:
132:operating system
109:Berkeley sockets
21:
4208:
4207:
4203:
4202:
4201:
4199:
4198:
4197:
4173:
4172:
4134:
4121:
4119:
4117:
4098:
4062:
4061:
4052:
4050:
4045:
4044:
4040:
4031:
4029:
4024:
4023:
4019:
4010:
4008:
4003:
4002:
3998:
3989:
3988:
3984:
3975:
3973:
3968:
3967:
3963:
3955:
3951:
3937:
3927:
3921:
3920:
3916:
3899:
3898:
3897:
3893:
3879:
3878:
3874:
3857:
3856:
3855:
3851:
3846:
3842:
3834:
3830:
3821:
3820:
3816:
3807:
3806:
3802:
3793:
3791:
3790:. Opengroup.org
3786:
3785:
3781:
3770:
3766:
3761:
3745:
3744:
3741:
3738:
3735:
3732:
3729:
3726:
3723:
3720:
3717:
3714:
3711:
3708:
3705:
3702:
3699:
3696:
3693:
3690:
3687:
3684:
3681:
3678:
3675:
3672:
3669:
3666:
3663:
3660:
3657:
3654:
3651:
3647:
3644:
3641:
3638:
3635:
3632:
3629:
3626:
3623:
3620:
3617:
3614:
3611:
3608:
3605:
3602:
3599:
3596:
3593:
3590:
3587:
3584:
3581:
3578:
3577:
3574:
3571:
3568:
3565:
3562:
3559:
3556:
3553:
3550:
3547:
3544:
3541:
3538:
3535:
3532:
3529:
3526:
3523:
3520:
3517:
3514:
3511:
3508:
3505:
3502:
3499:
3496:
3493:
3490:
3487:
3484:
3481:
3478:
3475:
3472:
3469:
3466:
3463:
3460:
3457:
3454:
3451:
3448:
3445:
3442:
3439:
3436:
3433:
3430:
3427:
3424:
3421:
3418:
3415:
3412:
3409:
3406:
3403:
3400:
3397:
3394:
3391:
3388:
3385:
3382:
3379:
3376:
3373:
3370:
3367:
3364:
3361:
3358:
3355:
3352:
3349:
3346:
3343:
3340:
3337:
3334:
3331:
3328:
3325:
3322:
3319:
3316:
3313:
3310:
3307:
3304:
3301:
3298:
3295:
3292:
3289:
3286:
3283:
3280:
3277:
3274:
3271:
3268:
3266:<errno.h>
3265:
3262:
3260:<stdio.h>
3259:
3256:
3253:
3250:
3244:
3239:
3238:
3235:
3232:
3229:
3226:
3223:
3220:
3217:
3214:
3211:
3208:
3205:
3202:
3199:
3196:
3193:
3190:
3187:
3184:
3181:
3178:
3175:
3172:
3169:
3166:
3163:
3160:
3157:
3154:
3151:
3148:
3145:
3142:
3139:
3136:
3133:
3130:
3127:
3124:
3121:
3118:
3115:
3112:
3109:
3106:
3103:
3100:
3097:
3094:
3091:
3088:
3085:
3082:
3079:
3076:
3072:
3069:
3066:
3063:
3060:
3057:
3054:
3051:
3048:
3045:
3042:
3039:
3036:
3033:
3030:
3027:
3024:
3021:
3018:
3015:
3012:
3009:
3006:
3003:
3000:
2997:
2994:
2991:
2990:
2987:
2984:
2981:
2978:
2975:
2972:
2969:
2966:
2963:
2960:
2957:
2954:
2951:
2948:
2945:
2942:
2938:
2935:
2932:
2929:
2926:
2923:
2920:
2917:
2914:
2911:
2908:
2905:
2902:
2899:
2896:
2893:
2890:
2887:
2884:
2881:
2878:
2877:
2873:
2870:
2867:
2864:
2861:
2858:
2855:
2852:
2849:
2846:
2845:
2842:
2839:
2836:
2833:
2830:
2827:
2824:
2821:
2818:
2815:
2812:
2809:
2806:
2803:
2800:
2797:
2794:
2791:
2788:
2785:
2782:
2779:
2776:
2773:
2770:
2767:
2764:
2761:
2758:
2755:
2752:
2749:
2746:
2743:
2740:
2737:
2734:
2731:
2728:
2725:
2722:
2719:
2716:
2713:
2710:
2707:
2704:
2701:
2698:
2695:
2692:
2689:
2686:
2683:
2680:
2677:
2674:
2671:
2668:
2665:
2662:
2659:
2656:
2653:
2650:
2647:
2644:
2641:
2638:
2635:
2632:
2629:
2626:
2623:
2621:<errno.h>
2620:
2617:
2615:<stdio.h>
2614:
2611:
2601:
2573:
2568:
2567:
2564:
2561:
2558:
2555:
2552:
2549:
2546:
2543:
2540:
2537:
2534:
2531:
2528:
2525:
2522:
2519:
2516:
2513:
2510:
2507:
2504:
2501:
2498:
2495:
2492:
2489:
2486:
2483:
2480:
2477:
2474:
2471:
2468:
2465:
2462:
2459:
2456:
2453:
2450:
2447:
2444:
2441:
2438:
2435:
2432:
2429:
2426:
2423:
2420:
2417:
2414:
2411:
2408:
2405:
2402:
2399:
2396:
2393:
2390:
2387:
2384:
2381:
2378:
2375:
2372:
2369:
2366:
2363:
2360:
2357:
2354:
2351:
2348:
2345:
2342:
2339:
2336:
2333:
2330:
2327:
2324:
2321:
2318:
2315:
2312:
2309:
2306:
2303:
2300:
2297:
2294:
2291:
2288:
2285:
2282:
2279:
2276:
2273:
2270:
2267:
2264:
2261:
2258:
2255:
2252:
2249:
2246:
2243:
2240:
2237:
2234:
2231:
2228:
2225:
2222:
2219:
2216:
2213:
2210:
2207:
2204:
2201:
2198:
2195:
2192:
2189:
2186:
2183:
2181:<stdio.h>
2180:
2177:
2174:
2171:
2168:
2165:
2162:
2159:
2156:
2153:
2112:
2090:
2085:
2084:
2081:
2078:
2075:
2072:
2069:
2066:
2063:
2060:
2057:
2054:
2051:
2048:
2045:
2042:
2039:
2036:
2033:
2030:
2027:
2024:
2021:
2018:
2015:
2012:
2009:
2006:
2003:
2000:
1997:
1994:
1991:
1988:
1985:
1982:
1979:
1976:
1973:
1970:
1967:
1964:
1961:
1958:
1955:
1952:
1949:
1946:
1943:
1940:
1937:
1934:
1931:
1928:
1925:
1922:
1919:
1916:
1913:
1910:
1907:
1904:
1901:
1898:
1895:
1892:
1889:
1886:
1883:
1880:
1877:
1874:
1871:
1868:
1865:
1862:
1859:
1856:
1853:
1850:
1847:
1844:
1841:
1838:
1835:
1832:
1829:
1826:
1823:
1820:
1817:
1814:
1811:
1808:
1805:
1802:
1799:
1796:
1793:
1790:
1787:
1784:
1781:
1778:
1775:
1772:
1769:
1766:
1763:
1760:
1757:
1754:
1751:
1748:
1745:
1742:
1739:
1736:
1733:
1730:
1727:
1724:
1721:
1718:
1715:
1712:
1709:
1706:
1703:
1700:
1697:
1694:
1691:
1688:
1685:
1682:
1679:
1676:
1673:
1670:
1667:
1664:
1661:
1658:
1655:
1652:
1649:
1646:
1643:
1640:
1637:
1634:
1631:
1628:
1625:
1622:
1619:
1616:
1613:
1610:
1607:
1604:
1601:
1598:
1595:
1592:
1589:
1586:
1583:
1580:
1577:
1574:
1571:
1568:
1565:
1562:
1559:
1556:
1553:
1550:
1547:
1544:
1541:
1538:
1535:
1532:
1529:
1526:
1523:
1520:
1517:
1514:
1511:
1508:
1505:
1502:
1499:
1496:
1493:
1490:
1487:
1484:
1481:
1478:
1475:
1472:
1469:
1466:
1463:
1460:
1457:
1454:
1451:
1448:
1445:
1442:
1440:<stdio.h>
1439:
1436:
1433:
1430:
1427:
1424:
1421:
1418:
1415:
1412:
1345:
1336:
1332:
1319:
1304:
1290:systems use of
1280:
1270:
1251:race conditions
1236:
1213:
1204:
1200:
1193:
1189:
1185:
1181:
1177:
1173:
1165:
908:
875:
870:
867:
861:
855:
851:
845:
841:
835:
824:
815:gethostbyaddr()
811:gethostbyname()
807:
754:
725:
719:
713:
697:
686:
680:
673:
669:
665:
661:
656:
634:
624:
618:
603:
594:
586:
577:
571:
565:
559:
555:
552:
544:
538:
528:
518:
513:
510:
502:
488:
478:
473:
470:
464:file descriptor
456:
413:gethostbyaddr()
409:gethostbyname()
332:
272:
245:
170:
162:wrapper library
125:
83:Unix philosophy
75:file descriptor
28:
23:
22:
15:
12:
11:
5:
4206:
4204:
4196:
4195:
4190:
4185:
4183:Network socket
4175:
4174:
4171:
4170:
4158:
4152:
4146:
4140:
4133:
4132:External links
4130:
4129:
4128:
4116:978-0321637734
4115:
4085:
4084:
4081:
4078:
4060:
4059:
4038:
4017:
3996:
3982:
3961:
3949:
3914:
3891:
3872:
3849:
3840:
3838:, p. 607.
3828:
3814:
3800:
3779:
3763:
3762:
3760:
3757:
3747:In this code,
3249:
3243:
3240:
2610:
2600:
2597:
2581:connectionless
2572:
2569:
2152:
2150:
2149:
2143:
2124:
2097:
2089:
2086:
1411:
1406:
1405:
1399:
1380:
1369:
1362:
1355:
1344:
1341:
1329:stream sockets
1303:
1300:
1269:
1266:
1235:
1232:
1228:Internet Layer
1212:
1209:
1156:
1155:
1152:
1148:
1147:
1146:(SNA) Project
1140:
1136:
1135:
1129:
1125:
1124:
1121:
1117:
1116:
1113:
1109:
1108:
1105:
1101:
1100:
1097:
1093:
1092:
1089:
1085:
1084:
1081:
1077:
1076:
1073:
1069:
1068:
1062:
1058:
1057:
1051:
1047:
1046:
1041:
1037:
1036:
1031:
1027:
1026:
1020:
1016:
1015:
1008:
1004:
1003:
999:Multiprotocol
997:
993:
992:
986:
982:
981:
976:
972:
971:
967:Amateur Radio
965:
961:
960:
957:
953:
952:
946:
942:
941:
936:
932:
931:
928:
907:
904:
873:
868:
864:
863:
859:
857:
853:
849:
847:
844:struct in_addr
843:
839:
837:
833:
823:struct hostent
822:
809:The functions
806:
803:
753:
750:
736:
735:
723:
721:
717:
715:
711:
696:
693:
689:
688:
684:
682:
678:
671:
668:SOCK_SEQPACKET
667:
663:
659:
655:
652:
645:
644:
632:
630:
622:
620:
616:
602:
599:
591:
590:
553:
550:
549:
548:
542:
539:SOCK_SEQPACKET
536:
526:
523:stream sockets
511:
508:
507:
506:
500:
486:
471:
455:
452:
451:
450:
444:
438:
432:
426:
423:freeaddrinfo()
416:
406:
400:
374:
368:
362:
356:
350:
331:
328:
325:
324:
321:
317:
316:
313:
309:
308:
305:
301:
300:
297:
293:
292:
289:
285:
284:
281:
271:
268:
244:
241:
238:
237:
232:
229:
225:
224:
219:
216:
212:
211:
208:
205:
201:
200:
197:
194:
190:
189:
186:
183:
169:
166:
124:
121:
26:
24:
14:
13:
10:
9:
6:
4:
3:
2:
4205:
4194:
4191:
4189:
4186:
4184:
4181:
4180:
4178:
4168:
4167:
4166:Linux Journal
4162:
4159:
4156:
4153:
4150:
4147:
4144:
4141:
4139:
4136:
4135:
4131:
4118:
4112:
4108:
4104:
4103:
4097:
4096:
4095:
4092:
4090:
4082:
4079:
4076:
4073:
4072:
4071:
4069:
4068:
4048:
4042:
4039:
4027:
4021:
4018:
4006:
4000:
3997:
3992:
3986:
3983:
3971:
3965:
3962:
3958:
3953:
3950:
3945:
3932:
3924:
3918:
3915:
3912:
3909:File Formats
3908:
3905: –
3902:
3895:
3892:
3887:
3886:ariadne.space
3883:
3876:
3873:
3870:
3866:
3863: –
3860:
3853:
3850:
3844:
3841:
3837:
3832:
3829:
3824:
3818:
3815:
3810:
3804:
3801:
3789:
3783:
3780:
3777:
3774:
3771:E. g. in the
3768:
3765:
3758:
3756:
3754:
3753:buffer_length
3750:
3247:
3241:
2608:
2606:
2598:
2596:
2594:
2589:
2587:
2582:
2578:
2570:
2148:
2144:
2141:
2137:
2133:
2129:
2125:
2102:
2098:
2095:
2094:
2093:
2087:
1409:
1404:
1400:
1397:
1393:
1389:
1385:
1381:
1378:
1374:
1370:
1367:
1363:
1360:
1356:
1354:
1350:
1349:
1348:
1342:
1340:
1330:
1324:
1323:
1313:
1309:
1301:
1299:
1289:
1284:
1277:
1275:
1267:
1265:
1263:
1259:
1254:
1252:
1247:
1243:
1241:
1233:
1231:
1229:
1225:
1221:
1217:
1210:
1208:
1197:
1169:
1153:
1150:
1149:
1145:
1141:
1138:
1137:
1133:
1130:
1127:
1126:
1122:
1119:
1118:
1114:
1111:
1110:
1106:
1103:
1102:
1098:
1095:
1094:
1090:
1087:
1086:
1082:
1079:
1078:
1074:
1071:
1070:
1066:
1063:
1060:
1059:
1056:
1052:
1049:
1048:
1045:
1042:
1039:
1038:
1035:
1032:
1029:
1028:
1025:
1021:
1018:
1017:
1013:
1010:Reserved for
1009:
1006:
1005:
1002:
998:
995:
994:
990:
987:
984:
983:
980:
977:
974:
973:
970:
966:
963:
962:
958:
955:
954:
950:
947:
944:
943:
940:
937:
934:
933:
929:
926:
925:
922:
920:
916:
911:
905:
903:
901:
897:
891:
889:
888:
883:
877:
876:is returned.
858:
848:
838:
832:
831:
830:
828:
820:
816:
812:
804:
802:
799:
795:
791:
787:
783:
781:
777:
773:
769:
765:
762:When using a
760:
758:
751:
749:
746:
744:
740:
733:
729:
722:
716:
710:
709:
708:
706:
702:
694:
692:
683:
677:
676:
675:
653:
651:
649:
642:
638:
631:
628:
621:
615:
614:
613:
611:
607:
600:
598:
584:
580:
574:
568:
562:
551:
543:
537:
534:
527:
524:
517:
516:
509:
501:
498:
494:
487:
484:
477:
476:
469:
468:
467:
465:
461:
458:The function
453:
448:
445:
442:
439:
436:
433:
430:
427:
424:
420:
419:getaddrinfo()
417:
414:
410:
407:
404:
401:
398:
394:
390:
386:
382:
378:
375:
372:
369:
366:
363:
360:
357:
354:
351:
348:
345:
344:
343:
336:
329:
322:
319:
318:
314:
311:
310:
306:
303:
302:
298:
295:
294:
290:
287:
286:
282:
279:
278:
275:
269:
267:
265:
261:
256:
254:
250:
242:
236:
233:
230:
227:
226:
223:
220:
217:
214:
213:
209:
206:
203:
202:
198:
195:
192:
191:
187:
184:
181:
180:
177:
175:
167:
165:
163:
159:
154:
152:
148:
143:
141:
137:
133:
130:
122:
120:
118:
114:
110:
106:
105:POSIX sockets
102:
98:
96:
90:
88:
84:
80:
76:
72:
68:
63:
61:
57:
53:
49:
45:
41:
37:
35:
19:
18:POSIX sockets
4164:
4120:. Retrieved
4101:
4093:
4086:
4065:
4063:
4051:. Retrieved
4041:
4030:. Retrieved
4020:
4009:. Retrieved
3999:
3985:
3974:. Retrieved
3964:
3956:
3952:
3940:|title=
3917:
3894:
3885:
3875:
3852:
3847:POSIX.1-2004
3843:
3831:
3817:
3803:
3792:. Retrieved
3782:
3767:
3752:
3748:
3746:
3709:EXIT_FAILURE
3455:EXIT_FAILURE
3245:
3140:EXIT_FAILURE
2973:EXIT_FAILURE
2604:
2602:
2590:
2574:
2559:EXIT_SUCCESS
2532:EXIT_FAILURE
2319:EXIT_FAILURE
2146:
2139:
2135:
2131:
2127:
2100:
2091:
2076:EXIT_SUCCESS
2037:EXIT_FAILURE
1941:EXIT_FAILURE
1839:EXIT_FAILURE
1764:EXIT_FAILURE
1563:EXIT_FAILURE
1407:
1402:
1395:
1391:
1387:
1383:
1376:
1372:
1365:
1358:
1352:
1346:
1320:
1305:
1285:
1278:
1273:
1271:
1255:
1248:
1244:
1237:
1214:
1198:
1170:
1159:
1115:routing API
985:PF_BLUETOOTH
935:PF_APPLETALK
912:
909:
892:
885:
878:
865:
814:
810:
808:
797:
793:
789:
785:
784:
779:
775:
771:
761:
756:
755:
747:
742:
738:
737:
731:
727:
704:
698:
690:
657:
647:
646:
640:
636:
626:
609:
605:
604:
592:
585:. The value
583:netinet/in.h
582:
578:IPPROTO_DCCP
566:IPPROTO_SCTP
459:
457:
447:setsockopt()
446:
441:getsockopt()
440:
434:
428:
422:
418:
412:
408:
402:
396:
392:
388:
384:
380:
376:
370:
364:
358:
352:
346:
341:
296:netinet/in.h
288:sys/socket.h
283:Description
273:
270:Header files
257:
246:
243:Alternatives
171:
155:
144:
126:
112:
108:
104:
94:
91:
64:
31:
29:
4122:27 February
3407:IPPROTO_UDP
3335:sockaddr_in
2871:IPPROTO_UDP
2693:sockaddr_in
2579:(UDP) is a
2274:IPPROTO_TCP
2268:SOCK_STREAM
2223:sockaddr_in
2105:sockaddr_in
1518:IPPROTO_TCP
1512:SOCK_STREAM
1482:sockaddr_in
1337:IPPROTO_TCP
1333:SOCK_STREAM
1310:(TCP) is a
1216:Raw sockets
1211:Raw sockets
1207:-constants
1176:instead of
1104:PF_SECURITY
664:SOCK_STREAM
572:IPPROTO_UDP
560:IPPROTO_TCP
519:SOCK_STREAM
485:(IPv4-only)
312:arpa/inet.h
235:getnameinfo
222:getaddrinfo
149:. Even the
113:BSD sockets
79:file handle
60:4.2BSD Unix
50:, used for
4177:Categories
4053:2012-07-26
4032:2012-07-26
4011:2012-07-26
3976:2012-07-26
3794:2012-07-26
3759:References
3658:bytes_sent
3579:bytes_sent
3506:sin_family
3401:SOCK_DGRAM
3347:bytes_sent
2865:SOCK_DGRAM
2801:INADDR_ANY
2765:sin_family
2605:recvfrom()
2364:sin_family
2109:sin_family
1668:INADDR_ANY
1608:sin_family
1325:, PF_INET6
1296:shutdown()
1220:user space
1151:PF_WANPIPE
1132:PPP over X
1096:PF_NETBEUI
927:Identifier
643:structure.
529:SOCK_DGRAM
515:, one of:
499:with IPv4)
389:recvfrom()
210:inet_ntop
207:inet_ntoa
199:inet_pton
196:inet_aton
42:(API) for
32:Berkeley (
3539:inet_addr
2720:socklen_t
2406:inet_pton
2101:connect()
2052:ConnectFD
2013:ConnectFD
1977:SHUT_RDWR
1971:ConnectFD
1896:ConnectFD
1860:ConnectFD
1353:socket().
1281:TIME_WAIT
1120:PF_PACKET
1088:PF_NETROM
1053:Novell's
1019:PF_ECONET
1007:PF_DECnet
996:PF_BRIDGE
989:Bluetooth
956:PF_ATMSVC
945:PF_ATMPVC
939:AppleTalk
786:connect()
757:connect()
728:socklen_t
637:socklen_t
365:connect()
174:reentrant
89:of data.
81:) in the
3931:cite web
3691:strerror
3624:sockaddr
3560:sin_port
3527:sin_addr
3299:#include
3293:#include
3287:#include
3281:#include
3275:#include
3269:#include
3263:#include
3257:#include
3251:#include
3122:strerror
3110:"%s
3049:sockaddr
2998:recvfrom
2903:sockaddr
2813:sin_port
2783:sin_addr
2657:#include
2648:#include
2642:#include
2636:#include
2630:#include
2624:#include
2618:#include
2612:#include
2550:SocketFD
2520:SocketFD
2463:sockaddr
2451:SocketFD
2433:sin_addr
2382:sin_port
2286:SocketFD
2250:SocketFD
2244:SocketFD
2196:#include
2190:#include
2184:#include
2178:#include
2172:#include
2166:#include
2160:#include
2154:#include
2147:close().
2121:sin_addr
2117:sin_port
2067:SocketFD
2025:SocketFD
1965:shutdown
1929:SocketFD
1872:SocketFD
1827:SocketFD
1785:SocketFD
1752:SocketFD
1695:sockaddr
1686:SocketFD
1650:sin_addr
1626:sin_port
1530:SocketFD
1494:SocketFD
1455:#include
1449:#include
1443:#include
1437:#include
1431:#include
1425:#include
1419:#include
1413:#include
1377:accept()
1373:accept()
1366:listen()
1316:socket()
1240:blocking
1162:socket()
1134:sockets
1128:PF_PPPOX
1067:sockets
1040:PF_INET6
1014:project
991:sockets
887:addrinfo
739:accept()
732:accept()
705:accept()
701:select()
672:listen()
660:listen()
641:sockaddr
627:sockaddr
610:socket()
554:protocol
545:SOCK_RAW
489:AF_INET6
460:socket()
429:select()
385:sendto()
371:accept()
359:listen()
347:socket()
304:sys/un.h
147:Internet
97:standard
95:de facto
36:) socket
4067:de jure
3907:FreeBSD
3865:FreeBSD
3512:AF_INET
3395:PF_INET
3221:recsize
3176:recsize
3098:fprintf
3083:recsize
3070:fromlen
2992:recsize
2859:PF_INET
2831:fromlen
2771:AF_INET
2723:fromlen
2714:recsize
2711:ssize_t
2445:connect
2412:AF_INET
2370:AF_INET
2262:PF_INET
2136:write()
2113:AF_INET
2111:set to
1614:AF_INET
1506:PF_INET
1403:close()
1392:write()
1322:PF INET
1292:close()
1274:connect
1061:PF_IRDA
1030:PF_INET
975:PF_CAN
964:PF_AX25
869:h_errno
798:connect
772:connect
752:connect
724:addrlen
718:cliaddr
685:backlog
633:addrlen
623:my_addr
503:AF_UNIX
479:AF_INET
403:close()
393:write()
320:netdb.h
251:-based
249:STREAMS
182:Action
151:Winsock
87:streams
56:library
4169:, 1998
4157:- 1996
4145:- 2007
4113:
3911:Manual
3869:Manual
3749:buffer
3733:return
3685:"
3673:printf
3642:sizeof
3621:struct
3609:buffer
3603:strlen
3597:buffer
3585:sendto
3533:s_addr
3488:sizeof
3467:memset
3437:printf
3389:socket
3368:buffer
3362:strcpy
3356:buffer
3332:struct
3242:Client
3227:buffer
3206:"
3194:printf
3161:"
3149:printf
3116:"
3104:stderr
3046:struct
3031:buffer
3028:sizeof
3022:buffer
2943:perror
2921:sizeof
2900:struct
2853:socket
2837:sizeof
2789:s_addr
2750:sizeof
2729:memset
2705:buffer
2690:struct
2599:Server
2556:return
2502:perror
2481:sizeof
2460:struct
2349:sizeof
2328:memset
2301:perror
2256:socket
2220:struct
2140:read()
2132:recv()
2128:send()
2088:Client
2073:return
1995:perror
1911:perror
1866:accept
1809:perror
1779:listen
1734:perror
1713:sizeof
1692:struct
1656:s_addr
1593:sizeof
1572:memset
1545:perror
1500:socket
1479:struct
1396:read()
1388:recv()
1384:send()
1359:bind()
1343:Server
1180:. The
1142:Linux
1139:PF_SNA
1072:PF_KEY
1050:PF_IPX
1024:Econet
1022:Acorn
1012:DECnet
1001:bridge
712:sockfd
695:accept
679:sockfd
654:listen
648:bind()
617:sockfd
606:bind()
472:domain
454:socket
435:poll()
397:read()
387:, and
381:recv()
377:send()
353:bind()
264:Genode
260:Plan 9
188:POSIX
71:handle
67:socket
38:is an
3718:close
3697:errno
3633:&
3566:htons
3473:&
3182:sleep
3128:errno
3067:&
3058:&
2955:close
2912:&
2819:htons
2795:htonl
2735:&
2593:TSAPs
2544:close
2514:close
2472:&
2424:&
2388:htons
2334:&
2061:close
2046:close
2019:close
2007:close
1923:close
1821:close
1746:close
1704:&
1662:htonl
1632:htons
1578:&
1262:ioctl
1258:fcntl
969:AX.25
915:Linux
101:POSIX
4124:2015
4111:ISBN
4075:IEEE
4064:The
3944:help
3724:sock
3703:exit
3661:<
3591:sock
3572:7654
3449:exit
3419:sock
3383:sock
3353:char
3326:sock
3314:void
3308:main
3134:exit
3086:<
3013:void
3004:sock
2985:(;;)
2967:exit
2961:sock
2891:sock
2885:bind
2847:sock
2825:7654
2702:char
2684:sock
2672:void
2666:main
2575:The
2526:exit
2394:1100
2313:exit
2211:void
2205:main
2138:and
2130:and
2031:exit
1935:exit
1884:NULL
1878:NULL
1851:(;;)
1833:exit
1758:exit
1680:bind
1638:1100
1557:exit
1470:void
1464:main
1394:and
1386:and
1306:The
1288:SVR4
1260:and
1224:ICMP
1192:and
1065:IrDA
900:NIS+
860:type
854:addr
840:addr
834:name
813:and
780:recv
778:and
776:send
601:bind
512:type
493:IPv6
491:for
483:IPv4
421:and
411:and
395:and
280:File
262:and
247:The
185:BSD
129:Unix
46:and
3700:));
3344:int
3323:int
3305:int
3215:int
3170:int
3131:));
2982:for
2681:int
2663:int
2588:).
2400:res
2241:int
2235:res
2232:int
2202:int
1857:int
1848:for
1491:int
1461:int
1339:).
1286:On
1166:PF_
919:BSD
917:or
850:len
670:).
34:BSD
4179::
4163:-
4109:.
4091:.
3935::
3933:}}
3929:{{
3884:.
3727:);
3712:);
3682:\n
3652:if
3648:);
3645:sa
3636:sa
3618:,(
3612:),
3575:);
3554:sa
3548:);
3521:sa
3500:sa
3494:);
3491:sa
3476:sa
3458:);
3446:);
3425:-1
3422:==
3413:if
3410:);
3377:);
3338:sa
3230:);
3203:\n
3191:);
3179:);
3158:\n
3143:);
3113:\n
3077:if
3073:);
3061:sa
2976:);
2964:);
2952:);
2933:-1
2930:==
2924:sa
2915:sa
2879:if
2874:);
2840:sa
2828:);
2807:sa
2804:);
2777:sa
2759:sa
2756:);
2753:sa
2738:sa
2696:sa
2607:.
2553:);
2535:);
2523:);
2511:);
2493:-1
2490:==
2484:sa
2475:sa
2439:if
2436:);
2427:sa
2397:);
2376:sa
2358:sa
2355:);
2352:sa
2337:sa
2322:);
2310:);
2292:-1
2289:==
2280:if
2277:);
2226:sa
2115:,
2070:);
2055:);
2040:);
2028:);
2016:);
2004:);
1986:-1
1983:==
1959:if
1956:*/
1944:);
1932:);
1920:);
1902:-1
1899:==
1890:if
1887:);
1842:);
1830:);
1818:);
1800:-1
1797:==
1791:10
1773:if
1767:);
1755:);
1743:);
1725:-1
1722:==
1716:sa
1707:sa
1689:,(
1674:if
1671:);
1644:sa
1641:);
1620:sa
1602:sa
1599:);
1596:sa
1581:sa
1566:);
1554:);
1536:-1
1533:==
1524:if
1521:);
1485:sa
1264:.
1205:AF
1201:PF
1194:PF
1190:AF
1186:AF
1182:AF
1178:PF
1174:AF
794:–1
743:-1
666:,
595:-1
575:,
569:,
563:,
383:,
379:,
119:.
65:A
30:A
4126:.
4056:.
4035:.
4014:.
3979:.
3946:)
3942:(
3925:.
3888:.
3825:.
3811:.
3797:.
3742:}
3739:;
3736:0
3721:(
3715:}
3706:(
3694:(
3688:,
3676:(
3670:{
3667:)
3664:0
3655:(
3639:,
3630:)
3627:*
3615:0
3606:(
3600:,
3594:,
3588:(
3582:=
3569:(
3563:=
3557:.
3542:(
3536:=
3530:.
3524:.
3515:;
3509:=
3503:.
3485:,
3482:0
3479:,
3470:(
3461:}
3452:(
3440:(
3431:{
3428:)
3416:(
3404:,
3398:,
3392:(
3386:=
3371:,
3365:(
3359:;
3350:;
3341:;
3329:;
3320:{
3317:)
3311:(
3236:}
3233:}
3224:,
3218:)
3212:(
3209:,
3197:(
3188:1
3185:(
3173:)
3167:(
3164:,
3152:(
3146:}
3137:(
3125:(
3119:,
3107:,
3101:(
3095:{
3092:)
3089:0
3080:(
3064:,
3055:)
3052:*
3043:(
3040:,
3037:0
3034:,
3025:,
3019:)
3016:*
3010:(
3007:,
3001:(
2995:=
2988:{
2979:}
2970:(
2958:(
2946:(
2939:{
2936:)
2927:)
2918:,
2909:)
2906:*
2897:(
2894:,
2888:(
2882:(
2868:,
2862:,
2856:(
2850:=
2843:;
2834:=
2822:(
2816:=
2810:.
2798:(
2792:=
2786:.
2780:.
2774:;
2768:=
2762:.
2747:,
2744:0
2741:,
2732:(
2726:;
2717:;
2708:;
2699:;
2687:;
2678:{
2675:)
2669:(
2565:}
2562:;
2547:(
2538:}
2529:(
2517:(
2505:(
2499:{
2496:)
2487:)
2478:,
2469:)
2466:*
2457:(
2454:,
2448:(
2442:(
2430:.
2421:,
2415:,
2409:(
2403:=
2391:(
2385:=
2379:.
2373:;
2367:=
2361:.
2346:,
2343:0
2340:,
2331:(
2325:}
2316:(
2304:(
2298:{
2295:)
2283:(
2271:,
2265:,
2259:(
2253:=
2247:;
2238:;
2229:;
2217:{
2214:)
2208:(
2142:.
2082:}
2079:;
2064:(
2058:}
2049:(
2043:}
2034:(
2022:(
2010:(
1998:(
1992:{
1989:)
1980:)
1974:,
1968:(
1962:(
1947:}
1938:(
1926:(
1914:(
1908:{
1905:)
1893:(
1881:,
1875:,
1869:(
1863:=
1854:{
1845:}
1836:(
1824:(
1812:(
1806:{
1803:)
1794:)
1788:,
1782:(
1776:(
1770:}
1761:(
1749:(
1737:(
1731:{
1728:)
1719:)
1710:,
1701:)
1698:*
1683:(
1677:(
1665:(
1659:=
1653:.
1647:.
1635:(
1629:=
1623:.
1617:;
1611:=
1605:.
1590:,
1587:0
1584:,
1575:(
1569:}
1560:(
1548:(
1542:{
1539:)
1527:(
1515:,
1509:,
1503:(
1497:=
1488:;
1476:{
1473:)
1467:(
1398:.
1368:.
1331:(
856:.
790:0
587:0
535:)
525:)
77:(
20:)
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.