Winsock VS DirectX

Started by
5 comments, last by SPAR 24 years, 1 month ago
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
Advertisement
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
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown
I am pretty sure DirectPlay uses Winsock.
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
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?
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.
cool thanks, that''s what i wanted to know!

This topic is closed to new replies.

Advertisement