11

What do you guys recommend for a resource for winsock?

I have an assignment that we have only have a few days to do that needs to send a simple packet using UDP (and receive the same type of packet).

I am fairly familiar with C# sockets but nothing with C++.

Any tips or resources?

bobber205
  • 12,366
  • 26
  • 72
  • 98
  • 1
    MSDN. http://msdn.microsoft.com/en-us/library/ms740673%28VS.85%29.aspx – vpram86 Mar 08 '10 at 05:00
  • Just a note about TCP/UDP: TCP packets are "guaranteed" to be delivered, UDP are not (they favor speed over reliability and may even arrive out-of-order.) So *expect* this and handle it appropriately for best results. – rdtsc Feb 01 '17 at 12:48

5 Answers5

10

Some are as follows:

Awsom3D
  • 840
  • 7
  • 22
Kyle Rosendo
  • 24,405
  • 7
  • 77
  • 115
5

Besides the MSDN resource "Getting Started with Winsock" mentioned already I would recommend the "Winsock Programmer's FAQ" on tangentsoft.net.

oli_arborum
  • 388
  • 3
  • 12
3

You need UDP, so use

  1. sendto()
  2. recvfrom()

APIs (Windows).

http://msdn.microsoft.com/en-us/library/ms740148%28VS.85%29.aspx

http://msdn.microsoft.com/en-us/library/ms740120%28VS.85%29.aspx

Poni
  • 10,625
  • 24
  • 76
  • 120
1

How about the step-by-step guide to getting started with Windows Sockets programming from the Winsock documentation on MSDN.

Remus Rusanu
  • 281,117
  • 39
  • 423
  • 553
1

Possibly more advanced than you need right now but...

I have a series of (rather old) articles on writing scalable servers using Winsock and IO Completion Ports and a free framework of code.

The code and links to the articles are available here.

Len Holgate
  • 20,658
  • 4
  • 43
  • 89