请赐教!

解决方案 »

  1.   

    在自定义的ip头中ttl字段写进去就行了。用socket raw了。
      

  2.   

    哪里有socket raw的详细资料??
      

  3.   

    例程:
     SOCKET sock;//your create socket handle
     int optval = 8;//suppose the ttl=8
     setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, (char *)&optval, sizeof(int));
      

  4.   

    例程(修正):
     SOCKET sock;//your create socket handle
     int optval = 8;//suppose the ttl=8
     setsockopt(sock, IPPROTO_IP, IP_TTL, (char *)&optval, sizeof(int));