Added error handling for minet_socket()