Resolved Socket receive large amounts of data

Infect3d

New member
Joined
Jul 29, 2009
Messages
4
Programming Experience
1-3
Hello all!
I've written a little application to start learn about sockets.
This application contact a remote server, the server when contacted start send a large amounts of data (100 or more MB)...the problem is that when the server start send the data, the application freeze!

I've tried to place Application.DoEvents() in the DataArrival event handle but with this the application crash :confused:

I use a StreamWriter to write the file to the hdd.

The code i have now is this:

VB.NET:
Private Sub Socket_OnDataArrival(ByVal Data As String, ByVal BytesRead As Integer) Handles Socket.OnDataArrival

        Do

            ObjSW.Write(Data)
            
            'Call Update(BytesRead)
            'Application.DoEvents()

        Loop Until BytesRead > 0

        'Me.Refresh()

End Sub

The data is received but i want to have the form "unlocked" because there are some informations like file size, path to file, progress etc... that i want to see.

Thanks!
 
Last edited:
I guess that works ... but you should have really used a seperate thread for receiving your data ... but I'm not quite sure what "socket" is anyway so a webclient might be just as good as far as overhead goes
 
Back
Top