Consoles and Winsock2

Started by
15 comments, last by ZippoLag 17 years, 8 months ago
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
Sig goes here =D
Advertisement
Look for a BSD sockets example program. Use that, as Winsock is just a minor variation on the same theme.
Except that you need to call WSAStartup() first.
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?
Sig goes here =D
Beej's Guide to Network Programming is rather popular and a good starting point, imo.
This space for rent.
Thanks I think that's what I was looking for more than BSD. I searched up BSD and it's an operating system?
Sig goes here =D
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?
Sig goes here =D
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" )

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.
Sig goes here =D
Quote:Original post by Woad
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.

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.

This topic is closed to new replies.

Advertisement