typedef struct sockaddr_ipx{
   short sa_family;
   char sa_netnum[4];
   char sa_nodenum[6];
   unsigned short sa_socket;

该结构中的每个参数它的作用是什么,能不能详细说一下,还有它跟sockaddr_in有没有什么对应关系
在csdn好像找不到该结构体!

解决方案 »

  1.   

    Addressing
    In an IPX network, network segments are bridged together using an IPX router. Each network segment is assigned a unique 4-byte network number. As more network segments are bridged together, IPX routers manage communication between different network segments using the unique network segment numbers. When a computer is attached to a network segment, it is identified using a unique 6-byte node number, which is usually the physical address of the network adapter. A node (which is a computer) is typically capable of having one or more processes forming communication over IPX. IPX uses socket numbers to distinguish communication for processes on a node.To prepare a Winsock client or server application for IPX communication, you have to set up a SOCKADDR_IPX structure. The SOCKADDR_IPX structure is defined in the Wsipx.h header file, and your application must include this file after including Winsock2.h. The SOCKADDR_IPX structure is defined astypedef struct sockaddr_ipx
    {
        short          sa_family;
        char           sa_netnum[4];
        char           sa_nodenum[6];
        unsigned short sa_socket;
    } SOCKADDR_IPX, *PSOCKADDR_IPX, FAR *LPSOCKADDR_IPX;The sa_family field should always be set to the AF_IPX value. The sa_netnum field is a 4-byte number representing a network number of a network segment on an IPX network. The sa_nodenum field is a 6-byte number representing a node number of a computer’s physical address. The sa_socket field represents a socket or port used to distinguish IPX communication on a single node.==================================
      
    Platform SDK: Windows Sockets 
    AF_IPX Address Family
    The IPX address family defines the addressing structure for protocols that use standard IPX socket addressing. For these transports, an endpoint address consists of a network number, node address, and socket number. The network number is an administrative domain and typically names a single Ethernet or token ring segment. The node number is a station's physical address. The combination of net and node form a unique station address that is presumed to be unique in the world. Net and node numbers are represented in ASCII text in either block or dashed notation as: '0101a040,00001b498765' or '01-01-a0-40,00-00-1b-49-87-65'. Leading zeros need not be present. The IPX socket number is a network/transport service number much like a TCP port number and is not to be confused with the Winsock socket descriptor. IPX socket numbers are global to the end station and cannot be bound to specific net/node addresses. For instance, if the end station has two network interface cards, a bound socket can send and receive on both cards. In particular, datagram sockets would receive broadcast datagrams on both cards.Caution  SOCKADDR_IPX is 14 bytes long and is shorter than the 16-byte SOCKADDR reference structure. IPX/SPX implementations may accept the 16-byte length as well as the true length. If you use SOCKADDR_IPX and a hard-coded length of 16 bytes, the implementation may assume that it has access to the 2 bytes following your structure.Field Value 
    sa_family Address family AF_IPX in host order. 
    Sa_netnum IPX network identifier in network order. 
    Sa_nodenum Station node address, flushed right. 
    Sa_socket IPX socket number in network order. Platform SDK Release: August 2001  
      

  2.   

    我这个msdn版本太旧啦,查不到,能不能用中文解释一下该结构的4个参数到底是怎样的?特别是中间那二个参数