Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> ipxpktsnd()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 IPXPktSnd()
------------------------------------------------------------------------------
 Purpose:
 Send an IPX packet to another workstation.

 Syntax:
 iCode = IPXPktSnd(lpszAddress, lpbyData, iLength )

 Parameters:
 lpszAddress The full network address of the workstation to receive the
             packet, consisting of the network number, the node number
             and the socket number.
 lpbyData    The data to send to the receiving workstation, up to 512
             bytes in length.
 iLength     The length of the data in bytes. If passed as the constant
             value NOVDEFINT, NOVLIB will calculate the data length by
             assuming the data is a null terminated C style string.

 Returns:
 A numeric value (signed short int).

 Description:
 IPXPktSnd() sends the data lpbyData to the workstation whose network
 address is specified by lpszAddress. lpbyData can be a character string
 or binary data up to 512 bytes in length.

 lpszAddress (the network address) is the physical address of the
 workstation that is to receive the packet, which is a 24 character string.
 The first 8 bytes represent the address of the network segment, the next 12
 bytes the physical address of the workstation and the last 4 bytes the
 socket number. For example, address "0000000208001BC657735555" is made up
 of the network segment "00000002", the workstation's address "08001BC65773"
 and the socket number "5555". All these figures are in hexadecimal.
 To find the network segment address and workstation address of a particular
 user, use functions WSNetAdrGet() and WSNdeAdrGet().
 IPXPktSnd() returns 0 if the packet was sent successfully, and
 NOVERRINT if an error occurs.

 NOTE: IPX does not guarantee delivery of packets, so the fact that a packet
 was sent successfully does not necessarily mean that the destination
 workstation actually received it. Use SPX calls if you need to be sure a
 packet was received. If the receiving workstation address is set to
 "FFFFFFFFFFFF" the packet is set to broadcast mode, which means the packet
 is sent to ALL workstations on the specified network segment.

 Example:
 // To send a packet containing the data "Hello There" to the
 // workstation whose address is "000000010800BC156445" and whose listening
 // socket is "5555" ( the default ). NOVLIB will calculate the length of
 // the data to be sent, so NOVDEFINT is passed for the length of the data.
 lpszAddress = "000000010800BC1564455555"
 if( IPXPktSnd(lpszAddress, "Hello There", NOVDEFINT ) = 0 )
    ? "Packet sent OK"
 endif
 // To send a packet containing the message "Server is going down in 5
 // minutes" to all workstations on network segment "00000005":
 lpbyMessage = "Server is going down in 5 minutes"
 lpszAddress = "00000005FFFFFFFFFFFF5555"
 if( IPXPktSnd( lpszAddress, lpbyMessage, LEN(lpbyMessage ) = 0 )
    ? "Packet sent OK"
 endif
 // To send a message to the supervisor's workstation:
 lpbyPacket = "Hello Supervisor"
 if UsrConLst( "SUPERVISOR" ) > 0
    iConnNo = UsrConLst("")
    lpszAddress = WSNetAdrGet( iConnNo )
          + WSNdeAdrGet( iConnNo )
          + "5555"
    if( IPXPktSnd( lpszAddress, lpbyPacket, LEN(lpbyPacket)) = 0 )
       ? "Packet sent OK"
    endif
 else
    ? "SUPERVISOR not logged in"
 endif

 Notes:
 By default the listening socket is 21845 ( 0x5555 ) unless
 IPXSktOpn() is given an explicit socket number to listen on. These
 examples assume that workstations are listening on the default socket
 number.

See Also: IPXInstalled() IPXSktOpn() IPXPktGet() IPXSktCls() WSNetAdrGet() WSNdeAdrGet()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson