Robert_Zenz
Well-known member
Hello there.
I wrote my own FTP-Class to communicate and download files from an FTP, while yesterday in the morning everything worked great, my code started to get buggy in the afternoon (don't ask, I have no idea...).
I'm using the TCPClient to connect to the FTP Server, but for some reason the connection keeps closing itself at certain points. I already had a packet sniffer running which indicated the Reset is coming from MY end...which is, in fact, a little confusing.
This is the code which I'm using to receive data:
I'm using this code construct at every point if I want to receive data...the first 'wave' of data is coming in without any problems, but at soon as the Read command is executed the Socket (prv_dataClient.Client) dies and closes the connection. The Timeout is set to 3 seconds and the FTP-Server is working great with every other program...why is the connection dying?
Thanks in advance,
Bobby
I wrote my own FTP-Class to communicate and download files from an FTP, while yesterday in the morning everything worked great, my code started to get buggy in the afternoon (don't ask, I have no idea...).
I'm using the TCPClient to connect to the FTP Server, but for some reason the connection keeps closing itself at certain points. I already had a packet sniffer running which indicated the Reset is coming from MY end...which is, in fact, a little confusing.
This is the code which I'm using to receive data:
VB.NET:
Dim buffer(size - 1) As Byte
Dim ptr As Integer = 0
Dim read As Integer = 0
Do
read = Me.prv_dataClient.Client.Receive(buffer, ptr, Me.prv_dataClient.ReceiveBufferSize, SocketFlags.Partial)
ptr += read
Loop While read > 0 AndAlso Me.prv_dataClient.Client IsNot Nothing AndAlso Me.prv_dataClient.Connected AndAlso Me.prv_dataClient.Available > 0
I'm using this code construct at every point if I want to receive data...the first 'wave' of data is coming in without any problems, but at soon as the Read command is executed the Socket (prv_dataClient.Client) dies and closes the connection. The Timeout is set to 3 seconds and the FTP-Server is working great with every other program...why is the connection dying?
Thanks in advance,
Bobby