alexstrat / simudp

NodeJS Socket.io/UDP proxy
10 stars 3 forks source link

Usefulness #2

Open Joncom opened 10 years ago

Joncom commented 10 years ago

Hi. I'm trying to get a sense of where this could be useful. UDP does have some very real benefits, but I'm not sure if they exist here. For example, say a browser sends packets 1, 2, and 3 to the proxy (in that order), but packet 1 is lost along the way, won't packet 2 and 3 both be delayed until packet 1 is retransmitted and received? It seems that the benefit of speed is lost here. Please correct me if I'm wrong because the prospect of UDP in the browser is exciting.

ramazanpolat commented 7 years ago

The purpose of the UDP is you know, making the transmission faster than TCP. Of course you may lose packets, that's the drawback but there are some cases that UDP perfectly fits for it. Think about it, where would you need speed and losing some packets won't be that much important? First thing coming to my mind is "real-time video transmission". BTW, thank you @alexstrat for this repo.

alexstrat commented 7 years ago

@ramazanpolat exact.

The initial purpose of this module was originally to be used in a JS(browser-side)-based implementation of Kademlia protocol (and join Kad) which is based on UDP.

I think an other advantage of UDP is that it's easier for NAT-traversal, reason why it's chosen for p2p applications (video calls, file sharing..) – hence its use in Kademlia.

arasmussen commented 7 years ago

Thoughts about using this vs socket.io for a networked WebGL game?