learning winsock

Started by
6 comments, last by Afr0m@n 18 years, 3 months ago
i've been using a dll for a socket for a long time, so i know the basics of how sockets work. i want to take it one step further though and start coding my own connections and transfers instead of using the dll. i've found a few tutorials on winsock, but nothing really good. i know a little win32, but not much. should i learn more win32 before i start learning winsock? i'm coding in c++ by the way, so if anyone knows of a good place to start learning winsock could you tell me. thank you.
Advertisement
You don't need to know WIN32 programming for winsock, C++ will do just fine. Try looking in the Multiplayer and Network Programming Articles here on Gamedev, I think there's a Winsock section there.
My Current Project Angels 22 (4E5)
You can start with the tutorials pointed at by the Forum FAQ. Win32 programming isn't necessary if you stick with the basic calls (socket(), select(), sendto(), recvfrom(), bind(), accept(), connect() and gethostbyname() home to mind).
enum Bool { True, False, FileNotFound };
Quote:Original post by hplus0603
You can start with the tutorials pointed at by the Forum FAQ.


No. I went through most of them yesterday, and the ones that has code that [might] work, require you to install a Unix or Linux OS. The one I can reccomend though, is this one. It has code you can download when you're finished with the article [which works]. The code in the actual article doesn't work.

_______________________Afr0Games
Quote:the ones that has code that [might] work, require you to install a Unix or Linux OS


I think the WinSock FAQ, pointed at by question 1, is a pretty good link, and it doesn't require Linux. I did, however, add a link to the article you posted; thanks!
enum Bool { True, False, FileNotFound };
I tried to compile the basic blocking server from that Winsock FAQ yesterday, and it didn't work even though I included the right header files and linked to the right libs.
_______________________Afr0Games
i've tried to do the tutorial in the link givin by afr0m@n and it didn't work. it keeps giving me errors saying cannot convert sockaddr_in to const sock_addr* for argument two in int connect, and addr_size undeclared. i'm guessing i'm suppose to define addr_size, but it doesn't say how to define it.
First of all; Did you download the accompanying source as opposed to using the code that's printed in the article? Secondly, use cast when you're having problems with converting data types. In your case;

int connect((const sock_addr*) sockaddr_in);
_______________________Afr0Games

This topic is closed to new replies.

Advertisement