• Advertisement
Sign in to follow this  

learning winsock

This topic is 4427 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement