9.0
Table Of Contents
- VMCI Sockets Programming Guide
- Contents
- About This Book
- About VMCI Sockets
- Porting to VMCI Sockets
- Creating Stream VMCI Sockets
- Creating Datagram VMCI Sockets
- Security of the VMCI Device
- Appendix: Learning More About Sockets
- Index
VMware, Inc. 13
3
ThischapterdescribesthedetailsofcreatingVMCIsocketstoreplaceTCPstreamsockets.
“PreparingtheServerforaConnection”onpage 14
“HavingtheClientRequestaConnection”onpage 17
Stream VMCI Sockets
TheflowchartinFigure 3‐1showshowtoestablishconnection‐orientedsocketsontheserverandclient.
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