Hi,
I want to apply program to send matrix from client and server ,and return back a processed matrix ..
How I can do it using UDP ,it was easy to use tcp for that!?
Thanks,
Hi,
I want to apply program to send matrix from client and server ,and return back a processed matrix ..
How I can do it using UDP ,it was easy to use tcp for that!?
Thanks,
Why would it make any difference to you?
You still have to create a message block containing the data you want to send, and you still have to call send() / recv() (oh ok, sendto() and recvfrom()), to transfer it.
The problems you have to look out for are:
- UDP is unreliable, you may not get the block you sent.
- UDP packets may arrive in a different order (to the order they were sent in).
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Hi Salem,
Thanks for your response!
I want to use UDP ,and get results the way as TCP - For example when I run the code in the server ,it started directly without waiting to get data from the client!?
How I can do the synchronization between the client & server using UDP ?
> it started directly without waiting to get data from the client!?
You look at the return result of recvfrom() to make sure you have some data.
Without you posting the code, this is all just wild guesswork and frankly a waste of time.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.