12

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,948
  • 27
  • 74
  • 100
  • 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

12

Some are as follows:

Awsom3D
  • 920
  • 7
  • 22
Kyle Rosendo
  • 25,001
  • 7
  • 80
  • 118
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
  • 11,061
  • 25
  • 80
  • 121
1

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

Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
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
  • 21,282
  • 4
  • 45
  • 92