🎉 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!

Multiperson Chat program - Lost Logic

Started by
3 comments, last by Edwin Park 22 years, 10 months ago
This is for LL. However, if anyone else can help me, please jump in! Hi. On page 148 in chapter 4 of your MGP book, you suggest that the reader should add support for more than two people in the SimpleChat program. How do you do this with the SocketObject class that you provide? I''m assuming that I need to have some kind of accept function in a loop. But I''m not sure how to accept multiple connections because of the blocking SocketObject::Accept() function. Is there a non-blocking version as well? Or is there an obvious way around this that I''m missing from the example code you provided in the chapter? Also, I''ve looked at the SocketObject header file and see the following functions, but there is no mention or explaination of them. static void thrReceiveThread(SocketTransmissionStruct *rs); static void thrSendThread(SocketTransmissionStruct &rs); Are these part of the solution? Thanks!
Advertisement
The UberAdventure program shows how to handle more than one connection at a time. Take a look at it and let me know if you still have questions.

LostLogic
www.lostlogic.com
Author, Multiplayer Game Programming

LostLogicwww.GamerOutfit.comXBox 360 Community Games Reviews and NewsExisled - 2D/3D Shooter for XBox 360

LostLogic,

Do you promote the use of I/O completion ports under NT/2000 in your book? I was looking at it on Amazon.com but didn''t notice any mention of that.

iocp (or to a lesser extent overlapped i/o without using iocp) is the only way to get the maximum performance under Windows NT/2000 when handling massive amount of information and connections.





Dire Wolf
www.digitalfiends.com
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com
Thanks for the info.

But, several things throw me off with this. I''ve been reading the chapters one by one, and I don''t remember seeing any mention or examples of the UberAdventure program and multithreading at all up to chapter 4. (yet the program shows up in the source code directory for chap4!?)

And at the end of the SimpleChat program in chapter 4, you tell the reader to implement multi-person support!? (I carefully studied the simple chat server program over and over again looking for clues. i even read ahead to chapter 5 to no avail...)

That was frustrating and a big waste of time. I expected that the feature could have implemented based on the techniques we had covered up to that point. chap 4 should not require chapter 6,7 and undiscussed source code. blah...

Alrighty. Now that I blew off some steam, I feel a little better.

*Don''t get me wrong, I like the book very much. If I didn''t, I wouldn''t have dished out my hard earned cash for it! but there are some caveats...

now off to study that code...


quote: Original post by LostLogic
The UberAdventure program shows how to handle more than one connection at a time. Take a look at it and let me know if you still have questions.

LostLogic
www.lostlogic.com
Author, Multiplayer Game Programming


Hi Edwin,

The UberAdventure program was thrown in as a "bonus," that is why the code for it is not covered. It is mentioned as being on the CD though in the book, but the text was probably so short that you missed it.

I apologize for the lack of more in the way of multi-socketed programs. No excuse, but the time-crunch for the project was severe and sacrifices had to be made. It was decided early on that DPlay would get the largest portion of coverage.

Anyways, let me know if you have problems with doing multiple connections. If you will, email me what OS you are working with and what your goal is. Sometimes using email to resolve an issue is easier than the message board. You can also ICQ me at 126068365.




LostLogic
www.lostlogic.com
Author, Multiplayer Game Programming

LostLogicwww.GamerOutfit.comXBox 360 Community Games Reviews and NewsExisled - 2D/3D Shooter for XBox 360

This topic is closed to new replies.

Advertisement