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
I use a StreamWriter to write the file to the hdd.
The code i have now is this:
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!
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
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: