Skip to main content
gamedev.net
🔒 Locked

Async Sockets or Multithreaded Blocking?

Started by Ranger_One 5 replies 300+ views
Original Post
Ranger_One
Ranger_One
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
Dean Harding
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.
Shannon Barber
Shannon Barber
Definetly not blocking - sequence & batch will give you the best performance.
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
daerid
daerid
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?
daerid@gmail.com
Dean Harding
Dean Harding
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.

KalvinB
KalvinB
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]
Dean Harding
Dean Harding
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.