329
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
sockets arbitrarily.
.Cmdbuffrq Method
Function:
For the selected socket (selection is made through
) pre-requests "numpages" number of buffer
pages (1 page= 256 bytes) for the CMD buffer of the
socket.
Syntax:
sock.cmdbuffrq(numpages as byte) as byte
Returns:
Actual number of pages that can be allocated (byte)
See Also:
Part
Description
numpages
Requested numbers of buffer pages to allocate.
Details
The CMD buffer is the buffer that accumulates incoming inband commands
(messages). This method returns actual number of pages that can be allocated.
Actual allocation happens when the sys.buffalloc method is used. The socket is
unable to receive inband commands if its CMD buffer has 0 capacity. Unlike for TX
or RX buffers there is no property to read out actual CMD buffer capacity in bytes.
This capacity can be calculated as num_pages*256-16 (or =0 when
num_pages=0), where "num_pages" is the number of buffer pages that was
GRANTED through the
method. "-16" is because 16 bytes are
needed for internal buffer variables.
Buffer allocation will not work if the socket port to which this buffer belongs is not
idle (
is not at 0- PL_SSTS_CLOSED) at the time when sys.
buffalloc executes. You can only change buffer sizes of sockets that are idle.
The CMD buffer is only required when inband commands are enabled (
= 1-YES).
.Cmdlen R/O Property
Function:
For the selected socket (selection is made through
) returns the length of data (in bytes) waiting to
be processed in the CMD buffer.
Type:
Word
Value Range:
Default= 0 (0 bytes)
See Also:
340
349
329
358
337
340
350
337