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

 Syntax:
 iCode = SPXPacketSend( 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).

 The CA-Clipper name for this function is:
 SPXPktSnd()

 Description:
 SPXPacketSend() 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. SPXPacketSend() can only be called after an SPX
 connection has been successfully set up using SPXConnect().

 SPXPacketSend() 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. SPXPacketSend() 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 UsrConnList( "KATIE" ) > 0
    iConnNo = UsrConnList( "" )
    lpszAddress =  WSNetAddressGet(iConnNo)
                + WSNodeAddressGet(iConnNo)
                + "4545"
    if( (dwSPXConn = SPXConnect( lpszAddress )) > 0 )
       ? "Connected to user KATIE, SPX connection No.",dwSPXConn
       lpbyMessage = "Welcome to an SPX session"
       if (SPXPacketSend(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() SPXPacketGet()

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