Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Book 4-Appendices - <b>spxlistcon()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SPXLISTCON()
 Opens the SPX sending and receiving buffer and waits for a connection in the
 background
------------------------------------------------------------------------------
 Syntax

     SPXLISTCON(<nSourceSocket>,[<nRecBuffer>],
        [<nSendBuffer>],[<nPacket>],[<lHeader>],
        [<nRepeat>],[<lWatchDog>],[<nECBs>]) --> nHandle

     Netware: 2.2 and 3.11

 Arguments

     <nSourceSocket>  Designates the socket number of the communication's
     transmitting side.

     <nRecBuffer>  Designates the selected size of the receiving buffer.
     If no value is passed for <nRecBuffer>, no receiving buffer is
     established.  The minimum size of the receiving buffer is <nPacket>.  If
     the value for <nRecBuffer> is too small, it is changed automatically by
     SPXLISTCON().  The maximum size of the receiving buffer is 64 KByte.

     <nSendBuffer>  Designates the selected size of the sending buffer.
     If no value is passed for <nSendBuffer>, no sending buffer is
     established.  The minimum size of the sending buffer is <nPacket>.  If
     the value for <nSendBuffer> is too small, it is changed automatically by
     SPXLISTCON().  The maximum size of the sending buffer is 64 KByte.

     <nPacket>  Designates the packet size of the data that is sent.  The
     packet size can be between 1 and 534 bytes.  Values outside of this
     range are changed automatically.  The default value is 534 Bytes.

     <lHeader>  Specifies whether only the data range (.F.) or the data
     range and the header of the packet (.T.) are to be transmitted to the
     receiving buffer.

     <nRepeat>  Designates the number of repeat attempts if a faulty
     packet transmission occurs.  The value is valid for all sending
     operations processed during a session.  A value of 0 indicates that SPX
     assumes the standard repeat value.

     <lWatchDog>  Designates whether the watchdog is activated (.T.) or
     not (.F).  This parameter allows the supervision of the connection with
     watchdog, an SPX internal mechanism.  If the supervision is activated,
     watchdog checks in regular intervals to see if the remote station is
     still responding.  The default value (.T.) activates the watchdog.

 Returns

     SPXLISTCON() returns a communication handle if the buffer has been
     established successfully.  If an error occurs, the function returns 0.

 Description

     SPXLISTCON() allows you to establish a communication buffer for an SPX
     communication with another station in the network.  SPXLISTCON() also
     installs a handler that waits for a connection setup by any other
     station.  The communication buffer can contain a sending and receiving
     buffer through which the interrupt controlled sending and receiving of
     data is processed.

     <nSourceSocket> is the socket number of the communication's transmitting
     side (see the Introduction to this chapter).  The socket can be opened
     with the function OPENSOCK() before the call of SPXLISTCON().  If
     <nSourceSocket> has not been opened, it is opened by SPXLISTCON()
     automatically.  If 0 is passed for <nSourceSocket>, SPXLISTCON() opens
     any available socket.

     The parameters <nRecBuffer> and <nSendBuffer> determine the size of the
     receiving and sending buffer.  The buffers are automatically designed
     for one NetBIOS packet.  Each buffer can be up to 64 KByte in size.
     However, the size of the buffer that is allocated by SPXLISTCON()
     depends on the application and the configuration of the computer used.

     <nPacket> determines the maximum size of the data range of the SPX
     packets that are sent or received.  The maximum value (and the default
     value) is 536 bytes.  Smaller packets can be sent without failure.
     However, larger packets are discarded.  The value of <nPacket> is also
     valid for use in sending data.

     With <lHeader> you can determine if the header of an SPX packet (42
     bytes) is transmitted to the receiving buffer.  The header can contain
     important information about the received packet.  For a description of
     the header structure, see the Introduction to this chapter.

     The number of repeat attempts for faulty send operations during the
     session can be specified with <nRepeat>.  A value of 0 sets an SPX
     internal standard value.

     A session is supervised by an SPX watchdog.  If the watchdog determines
     that the remote station is not responding, a key trap can be triggered
     (see PPCKEY()).  The connection flag for the session is set to .F..  If
     you want to deactivate the watchdog, the parameter <lWatchdog> can be
     designated .F..

     SPX needs Event Control Blocks (ECBs) for receiving data and for
     administration purposes.  The ECBs are created and managed by
     SPXLISTCON() automatically.  The default value is two ECBs for each SPX
     session.  The value can be increased if slow computers are used.
     However, you cannot prevent data loss that is the result of a full
     receiving buffer.

     If all parameters have been passed correctly and the buffers have been
     established successfully, SPXLISTCON() returns a communication handle.
     However, a communication handle does not indicate that an SPX has
     already been set up.  After SPXLISTCON() has been executed, a handler
     waits for a connection request in the background.  The communication
     handler, returned by SPXLISTCON(), cannot be used for sending and
     receiving before a connection has been established.  The current
     connection status after a call of SPXLISTCON() can be queried with
     PPCCONACT().  It is also possible to trigger a key trap with PPCKEY().

 Note

     .  Unlike an IPX communication, an SPX communication is
        connection-oriented.  A connection is established between two
        stations.  As long as no error occurs, a successful delivery of sent
        packets is guaranteed.

 Examples

     .  Wait for an SPX connection setup:

        nHandle=SPXLISTCON(20000,1000)
        WHILE .NOT. PPCCONACT(nHandle)
        ENDDO

     .  After an SPX connection has been set up successfully, put key
        code 255 into the keyboard buffer:

        #include "ctppc.ch"

        nHandle=SPXLISTCON(20000,5000,1000)
        PPCKEY(nHandle,255,PPC_CONESTB)

See Also: SPXESTBCON() PPCCANCEL() PPCKEY() PPCREAD()

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