Results 1 to 4 of 4

Thread: Pausing Transfers with Winsock ! How come?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    14

    Unhappy Pausing Transfers with Winsock ! How come?

    I'm building a FTP client and i don't know how pause transfer between the Server and my app with Winsock.
    The Server start putting data and never stops, even if i don't use the getdata method.

    If i put a Msgbox to ask for stopping, the server still continues putting data in the buffer. Why ?

    Does anybody know how pause the transfer while the message is showing without closing and restarting everything ?

    Thanks!!!

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well, to send large amounts of data, what I do is as follows :

    Client connects to server
    In the Server's ConnectionRequest event, it does any proprietary stuff, and then sends the first packet of data.
    Then I use the SendComplete event to send subsequent packets of data.

    If I want to slow down the sending of data, in the sendcomplete event I would call my DoSleep sub ;

    Code:
    Public Sub DoSleep
        Dim i As Long
        Do Until i = 1500
            DoEvents
            i = i + 1
        Loop
    End Sub

    The net effect of all that is that once, and only once, a piece of data has been sent, the app will count 1500 (thus appearing to sleep or wait), and then proceed with sending the next piece of data.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    14
    I don't wanna control the send. I'd like control de receiving data in my client app.

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well unless you write your own Data Flow Control protocol to be sent down the socket then you cant.

    What I mean by this is that the server will send when the client sends the SENDOK command, and will stop when the client sends the NOSEND command.

    But apart from that ... pff!
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width