//原文地址:http://blog.chinaunix.net/uid-26497520-id-3891017.html
这个问题很可能出在addrlen参数上,以下是man文档的解释
- If src_addr is not NULL, and the underlying protocol provides the
- source address, this source address is filled in. When src_addr is
- NULL, nothing is filled in; in this case, addrlen is not used, and
- should also be NULL. The argument addrlen is a value-result argument,
- which the caller should initialize before the call to the size of the
- buffer associated with src_addr, and modified on return to indicate the
- actual size of the source address. The returned address is truncated
- if the buffer provided is too small; in this case, addrlen will return
- a value greater than was supplied to the call.
自注: 大冬天的在工厂调试,遇到这种问题也是醉了