-
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.
-
Well, how are you sending the data ?
In chunks ?
- jamie.
-
Yes,
I used chunks of different sizes (2048 -> 8192 bytes) without any change.
Any idea?
-
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
-
Many thanks!!!
I didn't use the "DoEvents" function and it has a terrific effect!! (time transfer is now <5 sec.)
kind regards