Comments (2)
The constants you refer to are the largest message sizes, not packet sizes. For the actual MTU (max UDP packet size): The relevant constant is k_cbSteamNetworkingSocketsMaxUDPMsgLen
, which is currently 1300. Any messages passed to the API larger than about 1200 bytes will be fragmented into multiple UDP packets by the API. (The difference since we need to save some room for headers and such.) We would never try to send a 512KB UDP packet; there are practically no places on the Internet where that would work.
As for sending a 512KB message: it's really only reasonable for a reliable message, where there is retransmission in the event of individual segment loss. And that constant has to do with buffering really, not fragmentation and packet loss. For unreliable, the practical limit is much lower without forward error correction. (Say 5-20 MTU's?) or else the effective message delivery rate will plummet, as you mention.
We currently don't have a configurable MTU, and don't do MTU discovery. I am aware that it is a theoretical problem and that there might be some routers or network devices out there that cannot handle a UDP packet with a 1300-byte payload, and might either drop it or fragment it. But in practice, using this code on Dota and CS:GO basically all over the world, this hasn't posed a problem, so I don't think the set of users affected by this is large. I don't think it's worth the complexity to the interface to either allow customization (which then needs to be exposed to the user somehow) or to do the discovery/negotiation.
from gamenetworkingsockets.
Thank you for your reply. I'm sorry that I misunderstand the const value's meaning.
PS: I am trying to use this lib on a moblie phone game. In the past, the game's network layer used the TCP/IP protocol. Although we have done some optimizations on upper level, we still suffer from the jitter of the Internet.So I want to try some UDP based protocol. I have written a C#-style wrapper and hope to use this lib in our game.
from gamenetworkingsockets.
Related Issues (20)
- thread sanitizer detects issues HOT 4
- valgrind: Conditional jump or move depends on uninitialised value HOT 6
- lets move to zpp::bits!? HOT 2
- Steps to build for iOS and Android
- VCPKG / Building x86-windows-static
- Where/Who to contact for console access HOT 1
- cs2 and csgo ping HOT 1
- Early Retry Mechanism for SteamNetworkingSockets Authentication HOT 9
- Build fails to succeed for Windows / Visual Studio HOT 1
- Request to add compression
- minbase_decls.h always defines DLL_EXPORT on Windows (issues with static pthread)
- Build fails with clang 16 from non utf-8 garbage character
- Q: Performance warning
- Segmentation fault on CreateListenSocketIP using WSL2 Ubuntu
- Fail to build in windows 10 x64 due to openssl HOT 2
- Install with libsodium
- Unable to establish P2P with ICE
- test_p2p client failing
- Inaccuracy in the message sending function
- Emscripten/WebAssembly/WASM Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gamenetworkingsockets.