I am making a udp client to receive a simple text file,the code builds fine but gives me a blank console when run,after some observation I found out that the problem is occuring at the time of recetion,so I am pasting that part of my code,could someone please guide me...
if(data=recvfrom(sd, file_buffer, sizeof(file_buffer), 0, (struct sockaddr *) &server, &server_length)<0)
printf("Error receiving file.");
the point where I am receiving data:
data=recvfrom(sd, receivedData, sizeof(receivedData)-1, 0, (struct sockaddr *) &server, &server_length);
the point where I am writing data to the file:
if(fwrite(receivedData, 1, data, fp)!=data);
printf("Error writing file! \n");