UDP will be coming as a part of the WebRTC effort. The current spec draft and prototypes don't include arbitary data channels, but they are currently being specced on the mailing list.
You presuppose several things: 1) that "analytical" thinking (whatever that even means) is superior to "emotional" thinking, and 2) that benefits can be boiled down to economic nonsense (e.g. "money", "happiness").
Unity has UDP sockets and yes all good games that require fast real-time action need UDP. Adobe had it partially in their latest Flash Media Server RTMFP protocol but it was very limited.
RUDP or Reliable UDP is the best of both.
Here's some great info on UDP vs TCP and only using one or the other:
RUDP sounds very weird... why would you use it instead of TCP? At a glance, it looks like the only difference is RUDP doesn't enforce packets being received in-order (being a message-based protocol), while TCP does (being a stream-based protocol).
The great thing about UDP with a reliable layer on top is you can choose if you want an ACK back for any 'critical' data. Otherwise you can just ignore order or whether the endpoint receives it or not. It is a broadcast rather than a hard line essentially.
For instance let's say you have some physics update and for some reason you needed it networked, with many objects, receiving only 70% of those for many different elements may be just fine (discarding any you receive after that are older maybe for this example)...you may not need reliable acknowledgement that they received for most of them if any. But you definitely need to know when an enemy is killed so you make that a critical message to the server RPC'd to the clients and use a reliable flag which then will expect validation. Same with ordering... use when needed with RUDP or custom layer on UDP for reliability.
TCP does all this for you and works great for files/http etc. but doing this for all messages is great overkill in real-time games lower than turn based. And mixing TCP/UDP arguably causes some slowdown to UDP due to TCP queuing. RUDP solves all these issues and is flexible to reliable messages and just firehose broadcast.
Enforcing order is hugely important. With TCP, if you lose a packet, all incoming data to the app stops until it's recovered. This is disastrous for an app which can withstand some data being late but needs most of it to show up fast.
I think people would probably build their own communication protocol on top of UDP but not at the level of TCP, if they were given UDP support.
I'm not saying that's good or bad.
Back in college on a distributed systems course, one of the projects was exactly to build that because the professor wanted to produce somewhere between UDP (more than) to TCP (less than).
On the one hand there are tons off applications that don't need UDP and will do just fine with WebSockets. Lots of AJAX based sites can be made much more responsive through WebSockets. Email sites, sites like Google Docs, etc. Chat sites like Meebo or Google Talk. Even many types of games will do just fine with WebSockets. A WoW style game, a Diablo style game, etc.
On the other hand they, the w3c and the browser vendors, are working on unreliable (ie, UDP) peer to peer standard based off the WebRTC stuff so for those applications that can tolerate the unreliableness (ie, voip, video and real time games) it's not far off.
Thanks! I didn't know about WebRTC, so this seems like good news. Is it tailored to video/audio or are we talking about something you can design a protocol on top of?
I dispute the existence of "resources" in the abstract sense people are trying to achieve with respect to REST. The web is just a collection of stuff with ephemeral links to go from thing to thing. Obviously, these could be called "resources", but not in the coherent sense implied by REST.
I expected it, and yes it is because I touched on a belief system. People usually downvote without response when that happens.
I am big on REST I will reiterate, I included it in my own thesis in 2006 and the reason why I like it so much is it does make services more simple. I have been pusing it, JSON and simple apis since SOAP made my life hell (but was a needed notch to get away from proprietary formats and opening up data). Engineers jobs are to take complex things and make them simple to use for not just other engineers but non engineers without abstract thinking.
I just think repeating the historical mistakes of web services like SOAP can happen to JSON, REST and more if we don't check it with the current market and just keep it simple. I think REST is the way but you can have some flexibility for pragmatic business needs, lots of programmers cannot put business needs over ego at times. Don't tell people they aren't able to call it REST if it doesn't spit out ATOM representation and only use Accept headers.
Tell your business partners when your api doesn't work in a game engine because the http library didn't support headers that it isn't a true service and the client is unworthy of connecting. Or you could just use headers first then have other options/endpoints/abstracted urls to resources for non capable clients and still call it REST.
In the market today most big apis are RESTish RPC and that version will win because that is what is the most common service available today due to consumer/client demands. Granted it's not pretty.
If I want to raise my blood pressure into the 180's all I have to do is open a thread about web design "principles".
He has the perfect anti-example for HATEOAS right in there: financial transactions. You would never in 1 million years want to discover the API for such a thing by experimentation, because there are specific precision requirements.
Every time someone tries to explain the benefits of this nonsense to me it's either 1) something you could already do with sockets 20+ years ago, or 2) a poorly motivated academic idea that doesn't get me closer to implementing a correct system with good documentation.
The problem is designing all this nonsense into the bottom layer in the first place. I've never heard a good argument as to why any of this is better than just starting with raw sockets for an app talking to a server.
Take HATEOAS for example; a completely academic waste of time. Writing a tiny bit of API documentation isn't hard. Caching is an awful thing to be designing in without knowing the specific application. Verbs are a hack bolted on to make hideous form/link driven applications work when the user reloads or moves back/forward.
Except that when you follow all of REST, including HATEOAS, that part of the API documentation is FREE. And the caching is FREE, because its already been designed for you. Which is the whole point.
What? How can you say REST is going to give you a bunch of stuff "for free" when you haven't even seen the application. How do you know you're even going to get what you want? This is the central conceit here.
How can you say (TCP|Unix|C) is going to give you a bunch of stuff "for free" when you haven't even seen the application. How do you know you're even going to get what you want?
You don't, of course, but it's usually a pretty reasonable assumption that the effort involved in implementing your own (reliable stream sockets|scheduler and memory manager|high level language compiler) will eclipse severalfold any advantage from doing so. If you don't find that the same obtains from using HTTP and hypermedia then that's your position and you're welcome to it, but don't go assuming your experience is universal.
>You don't, of course, but it's usually a pretty reasonable assumption that the effort involved in implementing your own (reliable stream sockets|scheduler and memory manager|high level language compiler) will eclipse severalfold any advantage from doing so.
Wrong. I implement network protocols for a living, and I use often use UDP because TCP is not sufficient for the purpose. So yeah, this is the problem: your conceit that your upfront design is going to be "enough" for everything.
The fact that you think it us "usually" a valid assumption is exactly the conceit I am talking about. It's only "usually" assumed to be true because the people who have different requirements don't come to the web because it's such a limp platform.
If "I've never heard a good argument", "a completely academic waste of time" and "why should anyone non-academic building actual systems care what it means" aren't implications that your experience is valid and others' experiences aren't, then I concede and am happy to admit that you have totally Won The Argument if it makes you feel better
And btw, the point I am making is not against high level constructs. Once you have sockets you can build whatever you like. The problem is HTTP is the bottom level of the web. If you had proper facilities at the bottom you could have your HTTP as a library and I can have my real-time protocols. The web constrains engineers based on some academic's rationalistic ideas about optimisation.
Who actually uses or needs this kind of tooling? What exatly is "multi-service coordination" and why should anyone non-academic building actual systems care what it means? HATEOAS doesn't solve the problem anyway. What happens when a field requires fixed-point arithmetic to two places? Your tools are going to get that wrong unless you start adding types. In the end you need humans to read proper documentation and implement carefully thought out solutions. This is the XML conceit all over again.
Wow, what a weak crowd. No substantive criticism, just downvotes. The HN crowd should please refrain from arguing on the Internet about design until they've learned some basic systems programming.
If pg is sitting off in the background trying to convince people to click buttons with zero thought being exercised, then yes, Hacker News should be voluntarily time-limited. Until then, it is an apples-and-oranges comparison. Video games and TV have always been pretty pointless, but at least you were exercising some skill. These games are no better than slot machines, which are regulated in many places for good reasons.
I doubt there more skill being exercised when watching TV or looking at cat pictures at Reddit. I don't play these games but I think they probably are more engaging than other activities.
Zynga games and slot machines are an easy target for because they are time sinks that aren't common in HN crowd. But imagine some outsider looking at your day under a lens and regulating how you spend your time.
What should be the metric by which you classify an activity as being "good"? Inducing happyness? I bet if you ask Zygna customers they'd all say Farmville is their favorite game. Productivity?
Should people be allowed to spend large amounts of money to buy cars they don't really need? Electronics?
I'm not saying the govt should regulate Zynga. I'm pointing out that they do regulate slot machines. That's because people know slot machines can be bad for people, and are generally a pointless waste of time and money that feel good in the short term. Clubs and pubs that operate those machines and know damn well that people misuse them resist these regulations to the last. The same attitude toward voluntarily stopping these things is being displayed here. And the TV thing was an accidental misstatement. I think the same thing is true to some degree or another of serialised TV and most MMO's. Serialised TV is all about making you want to see the next episode. MMO's are all about rewarding high play times rather than skill.