ass2
ass2
h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
int main() {
int sock = 0;
FILE *file;
exit(EXIT_FAILURE);
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(PORT);
perror("Invalid address");
exit(EXIT_FAILURE);
exit(EXIT_FAILURE);
printf("Connected to server.\n");
if (file == NULL) {
close(sock);
exit(EXIT_FAILURE);
int bytes_received;
fclose(file);
close(sock);
return 0;