Creates a socket on the local machine at on given port. Call NewConnection() and pass the socket returned by this function to it. Returns a socket on success or -1 on error.