Changed string arguments to socket() call to constants, added getsockopt()