Using STOR not working properly in FTP client in C

I am writing an FTP client in C. Ive gotten pretty far with it, openining the connection, logging in, and entering PASV mode. but when I get to the STOR command, I am able to write an empty file to the server, but it hangs. I know that from the response, I get the data port and I used sscanf to get that into a variable. However, because STOR hangs, I cant continue with my code to open a new socket on that port. Am I supposed to use fork or thread here? Manually, I can simply open another shell and telnet to it and enter some data manually and then that data gets saved into the new file, but the point is I want to send my buffer of data and upload that to the remote FTP server. I just cannot do it while the STOR command hangs. How do I get around it? My goal is just to upload from a buffer in memory to a file on the remote machine. I don't need an active ftp client.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum