Hola, la verdad es que quiero hacer un servidor ftp y tengo un pc viejo para hosterar. Programe un cliente y servidor por sockets, pero quiero poder almacenar archivos en el servidor . Se que existe FireZilla pero quiero hacer todo desde 0 para poder entender mas del tema, si alguien me puede guiar con el tema seria de mucha ayuda, gracias de antemano y disculpa por preguntar lo mismo tantas veces. voy a dejar el código del servidor (Todo esta hecho en linux, creo que es importante aclarar eso)
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#define PUERTO 2000
int main(){
socklen_t longc;
int socket_host;
int socket_cliente;
char buffer[512];
socket_host = socket(AF_INET, SOCK_STREAM,0);
struct sockaddr_in servidor, cliente;
bzero((char * )&servidor, sizeof(servidor));
servidor.sin_family = AF_INET;
servidor.sin_port = htons(PUERTO);
servidor.sin_addr.s_addr = INADDR_ANY;
if(bind(socket_host,(struct sockaddr *)&servidor, sizeof(servidor)) == -1){
printf("Error en el bind\n");
return 1;
}
printf("Direccion %s:%d\n", inet_ntoa(servidor.sin_addr), htons(PUERTO));
listen(socket_host, 2);
while(free){
longc = sizeof(cliente); // TAMANO DE LA ESTRUCTURA CLIENTE
socket_cliente = accept(socket_host,(struct sockaddr *)&cliente, &longc);
printf("Escuchando en el puerto %d\n", ntohs(cliente.sin_port));
recv(socket_cliente,buffer,512,0);
printf("%s",buffer);
send(socket_cliente,"listo\n",7,0);
}
return 0;
}