Results 1 to 5 of 5

Thread: Copying files via the winsock control

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    Brussels (Belgium)
    Posts
    7

    Unhappy

    I everybody,


    I need to transfer files between a client and a server via the winsock control.

    I've already developped my own application which is running fine. The only problem is the transfer speed (20 sec. for 1 Mb!!!).

    Does anybody encounter such a problem??

    Thanks by advance.
    _________________________________
    JIEF

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well, how are you sending the data ?

    In chunks ?

    - jamie.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    Brussels (Belgium)
    Posts
    7
    Yes,

    I used chunks of different sizes (2048 -> 8192 bytes) without any change.

    Any idea?
    _________________________________
    JIEF

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Try the following ;

    Code:
    filenum = FreeFile
    Open "filename.txt" For Binary As #filenum
    Do While (Loc(filenum) < LOF(filenum))
         DoEvents
         var_data = Input(4096, #filenum)
         Winsock1.SendData var_data
    Loop
    Also, it depends on what sort of connection the data is going over. If you're dialing up to the net over a modem, then 1 meg in 20seconds is good. However if its a network ...

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    Brussels (Belgium)
    Posts
    7
    Many thanks!!!

    I didn't use the "DoEvents" function and it has a terrific effect!! (time transfer is now <5 sec.)


    kind regards
    _________________________________
    JIEF

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