🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

startThread () ?

Started by
1 comment, last by Taile 22 years, 7 months ago
here is a winsock tutorial written on gamedev.net: http://www.gamedev.net/reference/programming/features/ws2games/page4.asp everything seemed to work except for a few problems: Under accepting the connections client[number_of_clients] = accept (s, client_sock[number_of_sockets], &addr_size); Well, addr_size wasn''t declared in the example. It is reasonable to assume that the author may have expected the reader to do it himself, but someone new to the topic may not know what data type it is. Also, the second argument should be a sockaddr*, so it should be set to &client_sock[number_of_sockets]. Under the else section of that code startThread (client[number_of_clients]); What is that? I have no clue. It isn''t a function defined in . It either is in another header file (which I dont have...I already grepped for it...), or it is one he defined and didn''t tell the reader. Can someone tell me what it means?
Advertisement
The author is just illustrating how to go about setting up a multithreaded server.

startThread (client[number_of_clients]); is only to illustrate (I think) how you might go about organising your multithreaded server, but it is upto us (the reader) to fill in the details of this function. The author I think is only trying to illustrate and explain networking and not multithreading.

However, after saying all of that it is simple to remove any references to multithreading and make the application into a single process.

I went through this process some time ago and it all worked well. I can post some code if you are still stuck after trying the above.

henry
HenryLecturer in Computer Games TechnologyUniversity of Abertay DundeeScotlandUK
What is a thread, and what do you mean by multi-threading?

This topic is closed to new replies.

Advertisement