By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,578 Members | 1,617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,578 IT Pros & Developers. It's quick & easy.

Help with socket!

P: n/a
Hi,

I asked it previously but maybe I was not clear enough for having any
comments from you :)

When a socket is sending data, is there any test I have to do to be sure
that the outgoing packet is sent and I can trigger another sending of
messages?

Is it possible for a socket that has so much consecutive send, to loose
any of the messages it has to send?

Thank you
Marty
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
If you are using System.Net.Sockets there is a BeginSend and an EndSend
that you may use. I personaly cannot say I have had any problems with
losing packets or data even with some of the most robust network
applications. In your protocol you may wish to allocate part of your
header to ensure that packets are given an order. Also remember that
packets may be split up.
You may send 3 blocks of data and it might show up as 2 1/4 in one
packet and the remainging 3/4 in the second packet. Your application
needs to be able to handle this and reconstruct it. Once you have taken
care of that problem implemetning a simple numbering system in your
protocol header will ensure that you can tell when a packet is lost or
for some reason or another accidentally sent in the wrong order (if
possible).

Nov 21 '05 #2

P: n/a
Hi Marc,

Thank you for your reply.
You may send 3 blocks of data and it might show up as 2 1/4 in one
packet and the remainging 3/4 in the second packet. Your application
needs to be able to handle this and reconstruct it. Once you have taken
care of that problem implemetning a simple numbering system in your
protocol header will ensure that you can tell when a packet is lost or
for some reason or another accidentally sent in the wrong order (if
possible).


Yes, this I handle. Messages can but cut, so at the other end, the
client must keep in mind of the cutted part and save it.

But in the socket.send itself, do you think that this can be overrun?
and loose data?

I may do a test and send 1000 of messages in a loop and look at what the
client receive.

Regards,
Marty
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.