SDL Wiki
[ front page | index | search | recent changes | git repo | offline html ]
(This function is part of SDL_net, a separate library from SDL.)

NET_DatagramSocket

An object that represents a datagram connection to another system.

Header File

Defined in <SDL3_net/SDL_net.h>

Syntax

typedef struct NET_DatagramSocket NET_DatagramSocket;

Remarks

This is meant to be an unreliable, packet-oriented connection, such as UDP.

Datagram sockets follow different rules than stream sockets. They are not a reliable stream of bytes but rather packets, they are not limited to talking to a single other remote system, they do not maintain a single "connection" that can be dropped, and they are more nimble about network failures at the expense of being more complex to use. What makes sense for your app depends entirely on what your app is trying to accomplish.

Generally the idea of a datagram socket is that you send data one chunk ("packet") at a time to any address you want, and it arrives whenever it gets there, even if later packets get there first, and maybe it doesn't get there at all, and you don't know when anything of this happens by default.

Version

This datatype is available since SDL_net 3.0.0.

See Also


CategoryAPI, CategoryAPIDatatype, CategorySDLNet


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.