Fixed the error in the sockets.c (server) file, in which I forgot to use htons when stating the port number. Which would result in the error of connection refused.