Announcement

Collapse
No announcement yet.

rare events in TCP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • rare events in TCP

    Hello,


    Could somebody clear this up for me. If a TCP packet becomes fragmented into two packets, does winsock give two notification messages? or is this somthing I should worry about? The reason I am asking is that I am trying to send a structure through TCP and I dont have any way of checking that I recieved the whole thing. I have also tried the loop below but it seems to have some problems.

    I would also like to know what is the biggest string I can use with TCP SEND when the baud rate of your modile phone is only 2400. I suspect it would be araound 200 to 300.

    Code:
    type CRecord
        Well    as long
        Summary as string * 256
    end type
    
    Packet = ""
    Buffer = ""
    
    do
        tcp recv hClient,len(Record),Buffer
        if err then msgbox str$(errclear):end
        Packet = Packet & Buffer
    loop len(Buffer)
    
    lset Record = Packet
    ------------------
    Cheers

  • #2
    Technically you are at an application layer and the stack that fragments the packets is below you on the OSI model.


    So technically if you are not getting your data completely then hmmmmm


    See, TCP/IP Is byte oriented, the TCP/IP Stack (protocol on the machine) handles the fragmentation by verifying all bytes were received.

    If all bytes were not received it's below your application layer and there's something else wrong either with the stack or the code itself.

    Offhand it looks like you are not receiving it all based on the code, any GPF's occuring????

    Try doing something like this:

    Code:
      If Not Eof(hTcp) Then
         Tcp Line hTCP, Buffer
      End If
    ------------------
    Scott
    mailto:[email protected][email protected]</A>
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    Comment


    • #3
      Hello Scott!


      The reason I ask the above question was because in the PBDLL help file it says TCP does not reassemble fragmented packets. But acording to what you have said I shouldn't worry about that? As far as I know I have never not recieved a complete packet but I just want to make sure.

      ------------------
      Cheers

      Comment

      Working...
      X