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).

  1. Introduction

  2. Winsock Headers and Libraries

  3. Initializing Winsock

  4. Error Checking and Handling

  5. Addressing a Protocol

  6. Addressing IPv4

  7. Internet Addresses

  8. Some Note

  9. inet_ntoa() Function

  10. InetNtop() Function

  11. InetPton() Function

  12. Byte Ordering

  13. Creating a Socket

  14. Connection-Oriented Communication

  15. Server API Functions

  16. Binding, bind()

  17. Listening, listen()

  18. Accepting Connections, accept()

  19. Server Program Example

  20. Client API Functions

  21. TCP States

  22. connect()

  23. Client Program Example

 

 

 

  1. Data Transmission

  2. send() and WSASend()

  3. WSASendDisconnect()

  4. Out-of-Band Data

  5. recv() and WSARecv()

  6. WSARecvDisconnect()

  7. Stream Protocols

  8. Scatter-Gather I/O

  9. Breaking the Connection

  10. shutdown()

  11. closesocket()

  12. TCP Receiver/Server With select() Example

  13. TCP Sender/client Program Example

  14. Testing the TCP Client and Server Programs

  15. Testing the TCP Client and Server Programs in Private Network

  16. Connectionless Communication

  17. Receiver

  18. Sender

  19. Running Both the UDP Receiver/Server and UDP Sender/Client

  20. Testing the UDP Client and select Server Programs in Private Network

  21. Message-Based Protocols

  22. Releasing Socket Resources

  23. Miscellaneous APIs

  24. getpeername()

  25. getsockname()

  26. WSADuplicateSocket()

  27. Windows CE

  28. Conclusion

 

< Windows Station and Desktop | Win32 Programming | Winsock2 1 >