Re: Winsock - how to insure packets are received?
- From: "Sam" <no_address@xxxxxxxxxxxxxxxx>
- Date: Sun, 2 Mar 2008 09:20:02 -0800
"Bob Butler" <noway@xxxxxxxxxxx> wrote in message
news:u7GCqGHfIHA.5620@xxxxxxxxxxxxxxxxxxxxxxx
"Sam" <no_address@xxxxxxxxxxxxxxxx> wrote in message
news:%23M1%23n0BfIHA.4312@xxxxxxxxxxxxxxxxxxxxxxx
"Bob Butler" <noway@xxxxxxxxxxx> wrote in message
news:%23rP0iHAfIHA.4760@xxxxxxxxxxxxxxxxxxxxxxx
"Sam" <no_address@xxxxxxxxxxxxxxxx> wrote in message
news:%239sr5d$eIHA.4744@xxxxxxxxxxxxxxxxxxxxxxx
I'm using tcp.
Have you checked to see if any DataArrival events are getting more than
1 packet at one time? The number of packets sent is not guaranteed to
match the number received, only that the data when concatenated back
together is the same.
I'm not sure how to check for more than 1 packet. Maybe I phrased my
question incorrectly. I assume
the string that is contained within dataarrival is everything that's
sent. Do I need to monitor _dataarrival in some way?
The receiving end needs to be able to parse the incoming data and buffer
any partial packets received. For example, say the sender did this:
winsock1.SendData "aaaa"
winsock1.SendData "bbbb"
winsock1.SendData "cccc"
The receiver might get 3 packets of 4 bytes or might get something like
"aaaabb" followed by "bbcccc" or "aaaabbbb" followed by "cccc" or
"aaaabbbbcccc" or any combination that results in a total of 12 bytes in
the order sent.
You could go months getting everything as you expect it and then start
getting different results because of some unrelated change on the network.
If I iterate 1000 times from the client to the server on my local machine
and off to the receiving client's end, it works fine. All 1000 messages are
sent and received.
If I perform the same test from my computer to the server and off to the
client over the internet to my host provider, 150 out 1000 are received by
the server and client.
If I remove RC4 crypto it works perfectly on my machine and over the
internet.
Here is my design:
Flash (adobe) from the browser, receives an RC4 key under SSL from the
server.
The server puts the key in an array.
User presses send, flash encrypts the message with the new key.
The server decrypts the message
The server encrypts the message again with the receiving client's RC4 key
The client decrypts the message
Here is how the message is encrypted on the vb6 client using some crypto
code I found @ PSC (150 out of 1000 make it without error an message on
either side):
strdata = Replace(StrToHex(EncryptObject.EncryptString(Trim(txtmsg.Text),
rc4Key.Text)), Chr(0), "")
If I replace it with:
strData = Trim(txtmsg.Text)
Everything is fine.
.
- References:
- Winsock - how to insure packets are received?
- From: Sam
- Re: Winsock - how to insure packets are received?
- From: Ralph
- Re: Winsock - how to insure packets are received?
- From: Henning
- Re: Winsock - how to insure packets are received?
- From: Sam
- Re: Winsock - how to insure packets are received?
- From: Bob Butler
- Re: Winsock - how to insure packets are received?
- From: Sam
- Re: Winsock - how to insure packets are received?
- From: Bob Butler
- Winsock - how to insure packets are received?
- Prev by Date: Re: Tabstrip (NOT SSTAB)
- Next by Date: Re: mscomm32 / parallelport?
- Previous by thread: Re: Winsock - how to insure packets are received?
- Next by thread: Re: Winsock - how to insure packets are received?
- Index(es):
Relevant Pages
|