Re: Winsock - how to insure packets are received?




"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.

















.



Relevant Pages

  • Re: Diagnose co-location networking problem
    ... it was from the client. ... Actually there's significant indication of lost packets and clues that ... 540 retransmit timeouts ... are you using any packetfiltering on the server? ...
    (freebsd-net)
  • Re: process stuck in nfsfsync state
    ... >> server is wedged, not the client. ... Comparing the client and server traces, it looks like fragments in the ... loss for individual packets adds up. ...
    (freebsd-stable)
  • Re: TDS vs. TCP
    ... I start capturing the network traffic between SQL ... Server and the client. ... I don't see any TDS packets but the communication between SQL ... stand-a-lone server and the client, ...
    (microsoft.public.sqlserver.clustering)
  • Re: DHCP
    ... DHCPINFORM is used only if the client has ... >>> I would run ethereal on the server and catch all the packets exchanged ... >>> between the client and server. ... > implies that the host has a "working" IP address. ...
    (comp.os.linux.networking)
  • fax receiving problems
    ... I'm having a problem with a fax server at one of my client ... I recently installed the SBS 2003 fax server feature with a brand new ... Receiving is a little more tricky. ... see Help and Support Center at ...
    (microsoft.public.windows.server.sbs)

Quantcast