i am doing small ftp client for recieving some big files from ftp. I have read in RFC that ABOR command is very problematic for servers. Almost all servers i see just continue to send data even after ABOR sent through control connection. Closing the data transfer can result (in 70% of tests) in closing control connection also. The server just sends FIN packet after my pushed ABOR packet. What is the best good method to stop recieving at some byte and not lose the control connection? FlashFXP doing this ok on all types of connection delays and servers. While investigating tcp traffic i found standard ftp rfc flow.
But in my case still no success to abort transfer using this technique:
1) shutdown(passive_socket, SD_BOTH)
2) closesocket(passive_socket);
3) send(control_socket,"ABOR\r\n")
4) recv(control_socket) - stalled here
Thank you