inet_ntoa()把server_addr.sin_addr转换成字符串inet_addr()把字符串转换成和server_addr.sin_addr一样的类型:)还有其他的如:gethostbyname()等等可以参考