9 Years
Discussion Span
Last Post by leegao

i used google ;)
but when i tested in localhost progamm has sent only 5KB

and which would i use? udp or tcp?


udp or tcp?

UDP is an "unreliable" transfer protocol, ie if a packet is dropped or lost, it doesn't care. This is for high-demand but low-expectation connections (think streaming video: you don't care if you miss a frame or two because you can still see the entire video).

TCP is a reliable transfer protocol, with error correction. This method inherently is slower than udp as it needs to guarantee that every packet it sent successfully, thus it's important to use when you need high-fidelity transfers (ie, file transfers).

Read up on the different protocols here.


You do realize that C++ only supports ethernet (class 1) protocols and you must write your own wrapper to use higher level protocols (IP, TCP, + UDP) and generate your own packets.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.