3 ms·
How do you handle servers, which need to be accessible by desktop, mobile and web application? Can I use those low level API's or do you know some server/clien
by zubspace 6y ago
How do you handle servers, which need to be accessible by desktop, mobile and web application?
Can I use those low level API's or do you know some server/client libraries which simplify this for UDP and TCP channels?
- ColinWright 6y agoYour question is insufficiently specific ... it could mean nearly anything. You need to be clearer about what equipment you have, and what you're trying to accomplish. As it stands, I don't think anyone can answer except it a completely generic way: Almost every system has libraries to help, but it depends on what you're running on, what you're running over, and what you're trying to do.
- TheCoelacanth 6y agoThat is covered[1], though it is outdated if you want it to be able to handle as many connections as possible in a fast way. There are also thousands of higher-level libraries that would let you avoid having to deal with these lower-level APIs directly. [1] https://beej.us/guide/bgnet/html/#poll https://beej.us/guide/bgnet/html/#poll
- sdwr 6y agoIf you're serving webpages, look for a networking library that handles HTTP. If you're sending arbitrary chunks of data (like for a game), use a socket library. I've used WebSockets in the past, which handles the low-level stuff under the hood. There are libraries that implement it for Java, Go, C++, JS, etc. Check it out at https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_... It's not totally headache-free though - some issues I ran into were: - running locally vs over the internet - data formatting - recovering from timeouts/dropped connections