I need to copy a file from remote location.
I know following information.

a) Address of the remote file location
b) Port number
c) File Name
d) Size of file in bytes

How i copy the file from specified port/socket and write it to the file opened in local machine.
Which C++ function/class help to achieve this.

Please give some guidance to copy the specified number of bytes.