Chapter 1:An Intro to Windows Socket (Winsock2) Programming
|
||
|
C & Winsock: The Kick Start programming tutorialsC & Linux SocketProgram Example IndexC#, VB .NET & C++/CLI Network ProgrammingWindows Device Driver Development & Program ExamplesReactOS - Windows OS Binary Compatible Open Source Project - C & C++
|
What do we have in this chapter?
Initializing WinsockError Checking and HandlingAddressing IPv4Internet AddressesSome Noteinet_ntoa() FunctionInetNtop() FunctionInetPton() FunctionByte OrderingCreating a SocketConnection-Oriented CommunicationServer API FunctionsBinding, bind()Listening, listen()Accepting Connections, accept()TCP Statesconnect()send() and WSASend()WSASendDisconnect()Out-of-Band Datarecv() and WSARecv()WSARecvDisconnect()Stream ProtocolsScatter-Gather I/OBreaking the Connectionshutdown()closesocket()TCP Receiver/Server With select() ExampleTesting the TCP Client and Server ProgramsTesting the TCP Client and Server Programs in Private NetworkReceiverSenderTesting the UDP Client and select Server Programs in Private NetworkMessage-Based ProtocolsReleasing Socket ResourcesMiscellaneous APIsgetpeername()getsockname()WSADuplicateSocket()Windows CE
Summary
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. Later, we 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 just the IPv4 protocol.
|
|
|
|
Custom Search
|
|
|
< Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7 | Chap 2: Protocol Characteristics >
Share and email to your beloved friends and foes:
|
||