9.0

Table Of Contents
VMware, Inc. 25
ThisappendixintroducesInternetsocketsandprovidespointerstofurtherinformation.
“A b o u t BerkeleySocketsandWinsockonpage 25
“ShortIntroductiontoSockets”onpage 26
About Berkeley Sockets and Winsock
Asocketisacommunicationsendpointwithanameandaddressinanetwork.Socketsweremadefamousby
theirimplementationinBerkeleyUNIX,andmadeuniversalbytheirincorporationintoWindows.
Mostsocketbasedapplicationsemployaclientserverapproachtocommunications.Ratherthantryingto
starttwonetworkapplicationssimultaneously,oneappl
icationtriestomakeitselfalwaysavailable(theserver
ortheprovider)whileanotherrequestsservicesasneeded(theclientortheconsumer).
VMCIsocketsaredesignedtousetheclientserverapproachbut,unlikeTCPsockets,theydonotsupport
multipleendpointssimultaneouslyinitiatingconnec tionswithoneanother.
Datagoi
ngoverasocketcanbeinanyformat,andtravelineitherdirection.
ManypeopleareconfusedbyAF_INETasopposedtoPF_INET.Linuxdefinesthemasidentical.Thismanual
usesAFonly.AFmeansaddressfamily,whilePFmeansprotocolfamily.Asdesigned,asingleprotocolfamily
couldsupportm
ultipleaddressfamilies.Howeverasimplemented,noprotocolfamilyeversupportedmore
thanoneaddressfamily.ForInternetProtocolversion6(IPv6),AF_INET6issynonymouswithPF_INET6.
WinSockincludesvirtuallyalloftheBerkeleysocketsAPI,aswellasadditionalWSAfunctionstocopewith
cooperativemultitaskingandtheeventdr
ivenprogrammingmodelofWindows.
Programmersusestreamsocketsfortheirhighreliability,anddatagramsocketsforspeedandlowoverhead.
Trade Press Books
InternetworkingwithTCP/IP,Volume3:ClientServerProgrammingandApplications,Linux/PosixSocketsVersion,by
DouglasE.ComerandDavidL.Stevens,601pages,PrenticeHall,2000.
UNIXNetworkProgramming,Volume 1:TheSocketsNetworkingAPI,ThirdEdition,byW.RichardStevens(RIP),
BillFenner,andAndrewM.Rudoff,1024pages,A
ddisonWesley,2003.
Berkeley Sockets
WikipediaoffersanexcellentoverviewofthehistoryanddesignofBerkeleysockets.
ForreferenceinformationaboutBerkeleysockets,locateaLinuxsystemwithmanualpagesinstalled,andtype
mansocket.Youshouldbeabletofindbothsocket(2)andsocket(7)referencepages.
Appendix: Learning More About Sockets