Winsock control lost data 
Author Message
 Winsock control lost data

Let me try again...

I am currently trying to send data in VB5 with the Winsock control (TCP connection).  But whenever I'm sending it, some of it dissappears.  Like if I sent:

ABCDEF
ABCDEF
ABCDEF

Then it would come out looking like this:

ABCDEF
CDEF
ABCDEF

Here's the code:

S = FreeFile
Open "file.dat" For Input As #S
Do Until EOF(S) = True
    SendThis$ = ""
    For X = 1 To 20
        If EOF(S) = False Then
            Line Input #S, T$
            SendThis$ = SendThis$ & T$ & Chr(13) & Chr(10)
        End If
    Next X
    Winsock1.SendData SendThis$
    DoEvents
Loop
Close #S

I can't seem to figure out what exactly is going wrong.  If anyone can help or knows how to fix lost data over TCP, any info would be appreciated.



Sat, 21 Oct 2000 03:00:00 GMT  
 Winsock control lost data

Well,
your basic code is a bit out of the ordinary from what I'm used to.
why not do this:
LineFeed$ = (Chr(13) + Chr(10))
Open "DSDF.DAT" For Input As #1 ' or whatever
    Do While Not Eof(1) 'or whatever
        Line Input #1, Y$
            If Y$ <> "" Then
                SendThis$ = SendThis$ + Y$ + LineFeed$
            End If
            d$ = DoEvents()
Loop
Winsock1.SendData SendThis$

I'm guessing that the receiving application would be able to understand the line feed
in a single string and display it correctly

Quote:
> Here's the code:

> S = FreeFile
> Open "file.dat" For Input As #S
> Do Until EOF(S) = True
>     SendThis$ = ""
>     For X = 1 To 20
>         If EOF(S) = False Then
>             Line Input #S, T$
>             SendThis$ = SendThis$ & T$ & Chr(13) & Chr(10)
>         End If
>     Next X
>     Winsock1.SendData SendThis$
>     DoEvents
> Loop
> Close #S

> I can't seem to figure out what exactly is going wrong.  If anyone can help or knows how to fix lost data over TCP, any info would be appreciated.



Sat, 21 Oct 2000 03:00:00 GMT  
 Winsock control lost data

Well,
your basic code is a bit out of the ordinary from what I'm used to.
why not do this:
LineFeed$ = (Chr(13) + Chr(10))
Open "DSDF.DAT" For Input As #1 ' or whatever
    Do While Not Eof(1) 'or whatever
        Line Input #1, Y$
            If Y$ <> "" Then
                SendThis$ = SendThis$ + Y$ + LineFeed$
            End If
            d$ = DoEvents()
Loop
Winsock1.SendData SendThis$
Close #1 'or whatever
I'm guessing that the receiving application would be able to understand the line feed
in a single string and display it correctly

Quote:
> Here's the code:

> S = FreeFile
> Open "file.dat" For Input As #S
> Do Until EOF(S) = True
>     SendThis$ = ""
>     For X = 1 To 20
>         If EOF(S) = False Then
>             Line Input #S, T$
>             SendThis$ = SendThis$ & T$ & Chr(13) & Chr(10)
>         End If
>     Next X
>     Winsock1.SendData SendThis$
>     DoEvents
> Loop
> Close #S

> I can't seem to figure out what exactly is going wrong.  If anyone can help or knows how to fix lost data over TCP, any info would be appreciated.



Sat, 21 Oct 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Lost data with VB Winsock control and UDP GetData

2. Winsock data lost

3. Winsock lose data while debugging

4. Fix for VB5 winsock with losing data

5. WINSOCK LOSES DATA

6. WINSOCK LOSES DATA

7. Winsock Get Data getting lost in IE??

8. Lost data with Winsock

9. Lost data with Winsock

10. Winsock-control problem: DATAARRIVAL - events lost

11. Winsock Control sending data to Last control in array

12. ListView control losing data

 

 
Powered by phpBB® Forum Software