?
Solved

Internet communication problem (UDP)

Posted on 2001-06-03
4
Medium Priority
?
449 Views
Last Modified: 2010-04-06
Hello.

I'm currently developing a program that is suppose to
receive UDP packets.

I've successfully managed to send and receive single
UDP packets, however I need to receive a "stream" type
of udp packets. Example:

A server sends X UDP packets to me, how do I know when
the server is done sending? (I don't know how many packets the server will send and there is NO data within
the packet that will tell me that!)

The protocol that the server is using simply says:
.... but for now you just need to test for the end of the stream when you are reading in the constent string.

So my question is, how do i "test" for the end of a UDP stream? My socket is non-blocking (async)

To accept an answer I need source code, if component then there must be source to that too!

0
Comment
Question by:blasse
3 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 800 total points
ID: 6150246
UDP is 'connectionless', so there's no way to know, unless you number the packets yourself.
Another problem is that if one packet gets lost, the client will never know, unless you take care of error correction yourself.
0
 
LVL 3

Expert Comment

by:smurff
ID: 6151848
To be honest, thats why theres TCP or UDP. If you use TCP then it will have error checking and once a peice of data is sent, a "ACK" will be sent back to say "yes Ive got that data thanks"
Is there a reason why it has to be UDP?
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 8891050
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Please accept Epsylon's comment as answer.

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Robert Marquardt
EE Cleanup Volunteer
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question