Archived

This topic is now archived and is closed to further replies.

Ranger_One

Async Sockets or Multithreaded Blocking?

Recommended Posts

Anyone ever explore the performance advantages or disadvantages of each? I''m looking at this scenario: game server with 100+ open connections (TCP streams). With a newer gcc (2.95.3) and win2k will I run into any limit of the number of simultaneous sockets? I''ve heard stories of functions like select() capping at 64 sockets =/ Ranger

Share this post


Link to post
Share on other sites
quote:
Original post by Dean Harding
Asynchronous is the way to go. If you''re writing a server-type application for Windows NT/2000/XP, I highly recommend using I/O completion ports. There''s simply no faster method on that platform.


codeka.com - Just click it.


I have to agree 100%

IOCP is awesome on NT.

How would one go about something like that on a 98/ME platform tho?

Share this post


Link to post
Share on other sites
quote:
Original post by daerid
How would one go about something like that on a 98/ME platform tho?


Heh, with great difficulty 98/ME aren''t meant to run server applications (and in my opinion, you''d be crazy to try). You can write your own thread-pooling code fairly easily, but I''m not sure how you''d emulate the effect of I/O completion ports without resorting to using select or something similar (which is hella slow compared to I/O CPs)

If I had my way, I''d have all of you shot!


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
My TCP/IP Winsock tutorial in the DevZone has successfully made over 1000 connections. Both client and server are fully buffered so you don't have to worry about partial packets or multiple messages per packet.

The download includes a client and server (asyncronous) with a modified Winsock.H that supports up to 16,000 connections.

#define FD_SETSIZE 16000

In winsock.h that's by default 64. That's where the "limit" comes from.

You'd need IO completion ports to pull that many off though.

Ben


IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Dot Com ]


[edited by - KalvinB on July 29, 2002 5:39:40 AM]

Share this post


Link to post
Share on other sites
Yeah, it''s possible, but I bet if you compared the difference between using a 1,000 socket select and 1,000 sockets using I/O completion ports there''d be a big difference in performance

If I had my way, I''d have all of you shot!


codeka.com - Just click it.

Share this post


Link to post
Share on other sites