Solved

Internet communication problem (UDP)

Posted on 2001-06-03
4
437 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now