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>nbslistcon()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 NBSLISTCON()
 Opens the NetBIOS session sending and receiving buffer and waits for
 connection in the background
------------------------------------------------------------------------------
 Syntax

     NBSLISTCON(<cSourceName>,[<nRecBuffer>],
        [<nSendBuffer>],[<cTargetName>],[<nPacket>],
        [<nRecTimeout>],[<nSendTimeout>]) --> nHandle

     Netware: 2.2 and 3.11

 Arguments

     <cSourceName>  Designates the NetBIOS name 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 NBSLISTCON().  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
     NBSLISTCON().  The maximum size of the sending buffer is 64 KByte.

     <cTargetName>  Designates a NetBIOS name that specifies the target
     station.  If a value is passed for <cTargetName>, NBSLISTCON() waits for
     a connection request for this station.  The default value does not
     specify a target name.

     <nPacket>  Designates the packet size of the data that is sent in
     bytes.  The default value is 512 Bytes.

     <nRecTimeout>  Designates the timeout for the following receiving
     operations in 1/2 seconds.  The default value (0) designates no timeout.

     <nSendTimeout>  Designates the timeout for the following sending
     operations in 1/2 seconds.  The default value (0) designates no timeout.

 Returns

     If an operation is successful, NBSLISTCON() returns a communication
     handle.  The return value contains a numeric value that is greater than
     0.  You should store the handle in a variable because all further
     operations that refer to an established buffer require a communication
     handle.  If an error occurs, the function returns 0.

 Description

     NBSLISTCON() establishes a communication buffer for an NetBIOS session
     communication with other workstations in the network, and then waits for
     a connection setup through any other station.  The communication buffer
     can contain sending and receiving buffers through which the interrupt
     controlled sending and receiving of data is processed.

     <nSourceName> is the NetBIOS name of the process that transmits the data
     (see the Introduction to this chapter).  The name can be added to the
     local name table with the functions NBADDNAME() or NBADDGROUP() before
     the call of NBSLISTCON().  If <nSourceName> has not been added to the
     name table, it is added by NBSLISTCON() automatically.

     The parameters <nRecBuffer> and <nSendBuffer> specify the size of the
     receiving and sending buffers.  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 NBSLISTCON()
     depends on the application and the configuration of the computer used.

     The parameter <cTargetName> is optional.  When a value is passed for
     <cTargetName>, NBSLISTCON() waits for a connection request for
     <cTargetName>.  Without <cTargetName>, NBSLISTCON() reacts to any
     connection request.

     <nPacket> determines the maximum size of the data range of the NetBIOS
     packets to be sent or received.  The maximum and default value is 512
     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.

     The seconds for the timeout are not determined individually for each
     sending and receiving operation.  The timeout is set when the session is
     opened by passing the parameters <nRecTimeout> and <nSendTimeout>.  The
     parameters can contain numeric values that specify the timeout in steps
     of 1/2 second.

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

 Note

     .  Unlike a NetBIOS datagram communication, a NetBIOS session
        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 the setup of a NetBIOS session:

        nHandle=NBSLISTCON("MICK",1000)
        WHILE .NOT. PPCCONACT(nHandle)
        ENDDO

     .  After a NetBIOS session has been set up successfully, send key
        code 255 to the keyboard buffer:

        #include "ctppc.ch"

        nHandle=NBSLISTCON("MICK",5000,1000)
        PPCKEY(nHandle,255,PPC_CONESTB)

See Also: NBSCALL() PPCCANCEL() PPCKEY() PPCREAD() PPCWRITE()

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