Archived

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

Winsock VS DirectX

This topic is 6522 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am working on a multiplayer internet game and am wondering whether using Winsock functions or DirectX is faster/more reliable? I know the basics of implementation, but I would just like to know which is faster for communication via TCP/IP? SPAR1

Share this post


Link to post
Share on other sites
Winsock is low-level and therefore faster, DirectPlay is more high-level and requires less programming, but it may not be as flexible as you would like it to be.

I don''t think that DirectPlay (from DX7) is capable of maintaining mass online games or fast realtime FPS mplayer games, but for strategy games or similar when you don''t require really fast communication, it should be fine.

Isn''t DirectPlay mostly based on Winsock?

============================
Daniel Netz, Sentinel Design

"I'm not stupid, I'm from Sweden" - Unknown

Share this post


Link to post
Share on other sites
Both Winsock and DPlay implementations of the same protocol tend to have similar latency, but overall bandwidth is greater with DPlay, especially when creating a connection. Reliablility is pretty much the same as they work on the same network protocols.

Edited by - SiCrane on 3/9/00 10:55:55 PM

Share this post


Link to post
Share on other sites
When you say the overall bandwidth is bigger, do you mean that you can send more information or that it takes up more of the resources?

Share this post


Link to post
Share on other sites
More resources. I wrote a simple DPlay program to test this.

In this small case a client connecting sends 480 bytes and receives 772.

When sending messages over UDP, the messages are prefixed with the origin and destination player IDs - a total of 8 bytes.

When sending reliable messages over TCP, there is also 2 bytes for the packet length, 2 bytes of something else, and 16 (!!!) empty bytes. (a GUID?)

Setting DPSESSION_DIRECTPLAYPROTOCOL sends more packets, I didn''t bother counting.

Share this post


Link to post
Share on other sites