The Windows Socket 2 (Winsock2) Programming |
|
|
|
HOME
|
What do we have in this session?
This tutorial provides a kick start on Windows socket (Winsock) programming. It is not in depth tutorial, provided here as an introduction on the programming environment setup for Winsock 2. The advanced topics (and code examples) for Winsock 2 using C can be found at Winsock2 programming and the .NET version also available at .NET network programming (with C#, VB .NET and C++/CLI examples).
Initializing WinsockAddressing IPv4Internet AddressesSome NoteInetNtop() FunctionInetPton() FunctionCreating a SocketConnection-Oriented CommunicationBinding, bind()Listening, listen()Accepting Connections, accept()TCP Statesconnect()
send() and WSASend()WSASendDisconnect()Out-of-Band Datarecv() and WSARecv()WSARecvDisconnect()Scatter-Gather I/OBreaking the Connectionshutdown()closesocket()ReceiverMessage-Based ProtocolsReleasing Socket ResourcesMiscellaneous APIsgetpeername()getsockname()WSADuplicateSocket()Windows CEConclusion |
|
|
< Windows Station and Desktop | Win32 Programming | Winsock2 1 > |