Hi
i'm working on a File Sharing System what with more than 2 Connections at one Time. All is finished, the winsocks are running and all works fine...
[B]but![]()
when i was testing the File Transfer the Winsock only send 7 kb in 10 sec!! and in this moment i was testing it on one Computer now i wonder why it is so slow?
Can u help me?
here are some Parts of the VB Code
Here is the Part in the Data Arrival Event
Private Sub win_DataArrival(Index As Integer, ByVal bytesTotal As Long)
If donext(Index) = 3 Then
Dim bytesrev As Byte
win(Index).GetData bytesrev
saveit Index, bytesrev
Exit Sub
End If
Function saveit(WINI As Integer, vardat As Byte)
dtosd = FreeFile
Open SMP3Files(WINI) For Binary As dtosd
'before a transfer starts the filename is saved in the Array SMP3Files the same for the size
If LOF(dtosd) = wincmd(WINI) Then
win(WINI).Close
donext(WINI) = 1
Else
Put dtosd, LOF(dtosd) + 1, vardat
Close dtosd
End If
End Function
Here is the Function for sending
Function sendmp3file(WINSI As Integer)
Dim DTN
Dim SSDN As Integer ' Freefile
DTN = SSMP3Files(WINSI) 'Filename
SSDN = FreeFile
Open DTN For Binary As SSDN
Dim n
For n = 1 To LOF(SSDN)
Dim gbts As Byte
Get SSDN, n, gbts
bytessend(WINSI) = False
win(WINSI).SendData gbts
Do While bytessend(WINSI) <> True
DoEvents
Loop
Next n
If n = LOF(SSDN) Then Close SSDN: win(WINSI).close
End Function
hope someone knows the bug![]()


Reply With Quote