Solved

Internet communication problem (UDP)

Posted on 2001-06-03
4
438 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
4 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

772 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