Forum

> > Off Topic > C/C++ Winsock help
ForenübersichtOff Topic-ÜbersichtEinloggen, um zu antworten

Englisch C/C++ Winsock help

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: C/C++ Winsock help

oxytamine
User Off Offline

Zitieren
Wait! You also have to make a call to WSAStartup() before doing anything else with the sockets library. The code to do that looks something like this.
1
2
3
4
5
6
7
8
9
10
11
12
#include <winsock.h>
{
WSADATA wsaData;   // If this doesn't work
// WSAData wsaData; // then try this instead.

// MAKEWORD(1,1) for Winsock 1.1, MAKEWORD(2,0) for Winsock 2.0:

    if (WSAStartup(MAKEWORD(1,1), &wsaData) != 0) 
        {
            fprintf(stderr, "WSAStartup failed.\n");
            exit(1);
        }

alt Re: C/C++ Winsock help

KimKat
GAME BANNED Off Offline

Zitieren
Zitat
What is a socket? (theory).
Spoiler >
That's some pretty interesting stuff about WinSock. But what's FIFO? I almost misinterpreted it as FIFA (as in soccer/football), lol.

alt Re: C/C++ Winsock help

archmage
User Off Offline

Zitieren
Thanks I think I understand it, but would someone post source of a simple server and client?

@KimKat
FIFO is the acronym of "first in, first out".
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenOff Topic-ÜbersichtForenübersicht