# Consoles and Winsock2

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

## Recommended Posts

I've just finished reading the long article on using Winsock2 with C++ . I learned some things from it but not enough to go through the Main.cpp and delete all the miscellanious DirectX code and have the bare Winsock2 stuff and be able to use it with a (I think) Win32 Console Application. So how do I use the winsock stuff with the console app? I'm trying to make a MUD (the MUD book didn't make sense to me on how to set up the Winsock stuff, so unless you can explain how to get me started with it don't post a link saying read this). Just a .cpp with a very simple console application input ouput multi-user would help me out a lot as a kind of 'template' to help me learn. Thx

##### Share on other sites
Look for a BSD sockets example program. Use that, as Winsock is just a minor variation on the same theme.

##### Share on other sites
Except that you need to call WSAStartup() first.

##### Share on other sites
Thanks guys I'll start researching BSD, and since you said BSD is similar to WinSockets does that mean that it will not work on other operating systems besides Windows 95 and above as well?

##### Share on other sites
Beej's Guide to Network Programming is rather popular and a good starting point, imo.

##### Share on other sites
Thanks I think that's what I was looking for more than BSD. I searched up BSD and it's an operating system?

##### Share on other sites
Again with this problem =( There's always the step you have to do so everything works under project settings and something else. But I can't find where that is. Not even my dad could find it and he works for Microsoft doing stuff with Visual Studios. So where is it? A hotkey to use it or anything?

##### Share on other sites
Quote:
 There's always the step you have to do so everything works under project settings and something else.

It would be a lot easier to help if you told us what you were actually trying to do...

All you have to do to 'setup' winsock in MSVC++ is this...
#include <winsock2.h>#pragma comment( lib, "WS2_32.lib" )

##### Share on other sites
Thanks Deyja that helps out, and btw I did say what I was trying to do:

"I'm trying to make a MUD" was in my first post. Which means I'm trying to make a multiplayer MUD.

##### Share on other sites
Quote:
 Original post by WoadThanks Deyja that helps out, and btw I did say what I was trying to do:"I'm trying to make a MUD" was in my first post. Which means I'm trying to make a multiplayer MUD.

Granularity. Given that making a MUD involves a ton of things that have nothing to do with networking and/or sockets, clearly that's a useless piece of information in this context. If you want quick and accurate help, you have to learn to give detailed and relevant information. Call it fair exchange, if you will.

• 47
• 12
• 10
• 10
• 9
• ### Forum Statistics

• Total Topics
631373
• Total Posts
2999645
×