Conclusion
In this chapter, we presented the core Winsock functions that are required for connection-oriented and connectionless communication using the TCP and UDP protocols specifically. For connection-oriented communication, we demonstrated how to accept a client connection and how to establish a client connection to a server. We covered the semantics for session-oriented data-send operations and data-receive operations. For connectionless communication, we also described how to send and receive data. Since this chapter was designed to introduce the core Winsock APIs, we did not address network programming performance considerations. Chapter 6 will address performance issues and introduce the Microsoft Winsock extensions TransmitFile, TransmitPackets, AcceptEx, GetAcceptExSockaddrs, ConnectEx, DisconnectEx, and WSARecvMsg, which can help you write high performance, scalable Winsock applications.
Our discussions so far have demonstrated using Winsock with the IPv4 protocol. In the next three chapters, we will present the design of the Winsock architecture and show how to use other available protocols.