9.0

Table Of Contents
VMware, Inc. 13
3
ThischapterdescribesthedetailsofcreatingVMCIsocketstoreplaceTCPstreamsockets.
“PreparingtheServerforaConnection”onpage 14
“HavingtheClientRequestaConnection”onpage 17
Stream VMCI Sockets
TheflowchartinFigure 31showshowtoestablishconnectionorientedsocketsontheserverandclient.
Figure 3-1. Connection-Oriented Stream Sockets
WithVMCIsocketsandTCPsockets,theserverwaitsfortheclienttoestablishaconnection.Afterconnecting,
theserverandclientcommunicatethroughtheattachedsocket.InVMCIsockets,avirtualsocketcanha
ve
onlytwoendpoints,andtheserver cannotinitiateaconnectiontotheclient.InTCPsockets,morethantwo
endpointsarepossible,thoughrare,andtheservercaninitiateconnections.Otherwise,theprotocolsare
identical.
Creating Stream VMCI Sockets
3
socket()
bind()
listen()
accept()
Server
wait for client connection
send()
select()
recv()
connect()
establish connection
context ID
socket()
Client
recv() send()
close() close()
transmit data
reply to data
loop