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> spxpktsnd()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SPXPktSnd()
------------------------------------------------------------------------------
 Purpose:
 Send an SPX packet to a connection partner.

 Syntax:
 iCode = SPXPktSnd( wConNum, lpbyData, iLength )

 Parameters:
 wConNum  The connection number to which to send the SPX packet.
 lpbyData The data to send to the connection partner, up to 512 bytes
          in length.
 iLength  The length of lpbyData in bytes. If passed with the constant
          value NOVDEFINT, NOVLIB will calculate the data length and
          assume the data is a null terminated C style string.

 Returns:
 A numeric value (signed short int).

 Description:
 SPXPktSnd() sends the data lpbyData to the SPX connection partner
 wConNum. The data to be sent is a character string or binary data of up
 to 512 bytes in length. SPXPktSnd() can only be called after an SPX
 connection has been successfully set up using SPXConnect().

 SPXPktSnd() returns 0 if the packet was received successfully by the
 connection partner, or an error code if an error occurs.
 Unlike IPX, SPX guarantees receipt of a packet by sending back an
 acknowledgment. SPXPktSnd() does not return until that acknowledgment
 is received, or an error has occurred.

 Example:
 // To attempt to connect to user KATIE as an SPX partner and then send
 // her a welcome message:
 if UsrConLst( "KATIE" ) > 0
    iConnNo = UsrConLst( "" )
    lpszAddress =  WSNetAdrGet(iConnNo)
                + WSNdeAdrGet(iConnNo)
                + "4545"
    if( (dwSPXConn = SPXConnect( lpszAddress )) > 0 )
       ? "Connected to user KATIE, SPX connection No.",dwSPXConn
       lpbyMessage = "Welcome to an SPX session"
       if (SPXPktSnd(dwSPXConn, lpsMessage,LEN(lpsMessage))=0)
          ? "Message sent successfully"
       endif
    else
       ? "User KATIE is not listening"
    endif
 else
    ? "User KATIE is not logged in"
 endif

See Also: SPXInstalled() SPXConnect() SPXPktGet()

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