Getting Started With MUD's
You've obviously copied the code from somewhere (I haven't read a lot of the thread to see if that was mentioned), but the fact is that startThread is a user defined function, it is likely not defined in any library shipped with the compiler. Winsock coding can be tricky at times, and you have to be comfortable with pointers in addition to knowing C or C++. I could sit here and answer your question by giving a working solution but then you'd keep coming back with more problems where it'd be in your best interest to get to the basics and learn the language well enough to handle some of the useful things available like the winsock library. Please heed that advice, it's not meant to belittle.
I did use some copy/paste, but I read through everything and such, and also in the article's source, the startThread function is not defined anywhere anyways. I haven't found it with google/gamedev searching. So, please stop flaming me, and help me out, thanks a ton.
Quote:Original post by brandonman
I did use some copy/paste, but I read through everything and such, and also in the article's source, the startThread function is not defined anywhere anyways. I haven't found it with google/gamedev searching. So, please stop flaming me, and help me out, thanks a ton.
The tutorial you used uses startThread as pseudocode for a CreateThread wrapper. Doing sockets that way (with a thread for each client) is a complete waste of resources.
I'd recommend re-reading the article, then using a select-based approach to handling connections (ie, asynchronous sockets).
Not to be a noob, but where would I splice the select() function into my code, and how would I do it? Hopefully the last question.
To be brutally honest, if you think pointers is an advanced part of C++, you're not ready for this (it's absolutely essential).
I'd suggest either 1) learn C++ more deeply before broaching something like this, or 2) consider picking up and using C# instead (it'll be much, much easier to get into the more advanced concepts like networking and threading using C#, rather than C++ which is rather clunky and takes a long time to get comfortable with).
I'd suggest either 1) learn C++ more deeply before broaching something like this, or 2) consider picking up and using C# instead (it'll be much, much easier to get into the more advanced concepts like networking and threading using C#, rather than C++ which is rather clunky and takes a long time to get comfortable with).
Quote:On a scale 1-5 as far as C/C++ skills go for me, I'd rate myself a 3.5
If you don't know pointers or polymorphism, then you should rate yourself 1 on a scale from 1 to 5.
Also read question 0 in the Forum FAQ as it will help you a lot with this and other problems.
I don't consider pointers "Advanced" really, I should have rephrased that post, I just never could exactly get what their use was. I mean, it returns the address location of a variable it points to. I don't see why you can't just use that variable. Back on track - where exactly should I splice the select() function into my code?
You will not make more progress until you learn the language you're trying to express yourself in. Pointers are the only way you can use the heap, and using the heap is the only way you can have a dynamic memory store.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement