IRISLIB database
OS Class Reference

Output Stream

This class contains methods to send items framed in $LIST format to a TCP stream. More...

Inheritance diagram for OS:
Collaboration diagram for OS:

Static Public Member Functions

_.Library.Integer Clear ()
 Output Stream

This class contains methods to send items framed in $LIST format to a TCP stream. More...
 
_.Library.Integer LogFlags (_.Library.Integer flags)
 Get and optionally set logging flags. More...
 
_.Library.Integer Send (_.Library.String item)
 Send items to the output stream. More...
 
_.Library.Integer SendFlush (_.Library.String item)
 Send items to the output stream and flush the buffer. More...
 
_.Library.Integer SendRequest (_.Library.Integer msgid, _.Library.Integer contxt, _.Library.Integer opcode, _.Library.String item)
 Send a Native DB request to the output stream. More...
 
_.Library.Integer StartLog (_.Library.Integer flags)
 Start logging to file "sysio_pid.log". More...
 
_.Library.Integer StopLog ()
 Stop logging and close file "sysio_pid.log". More...
 
- Static Public Member Functions inherited from Help
_.Library.String Help (_.Library.String method)
 This is a helper class that is used by the various SYSTEM classes to provide a Help method. More...
 

Detailed Description

Output Stream

This class contains methods to send items framed in $LIST format to a TCP stream.

It is part of the InterSystems IRIS Native API. The other endpoint is usually an IRIS server. For input stream methods see <class>SYSTEM.IS</class>.

Member Function Documentation

◆ Clear()

_.Library.Integer Clear ( )
static

Output Stream

This class contains methods to send items framed in $LIST format to a TCP stream.

It is part of the InterSystems IRIS Native API. The other endpoint is usually an IRIS server. For input stream methods see <class>SYSTEM.IS</class>.

Remove any data remaining in the output stream buffer.



Return: 0

◆ LogFlags()

_.Library.Integer LogFlags ( _.Library.Integer  flags)
static

Get and optionally set logging flags.



Parameters:
flags Optional new flags (bit values can be added):

  • 1 - Raw input
  • 2 - Raw output
  • 4 - IS.Execute() received opcodes

Return:

  • current flags if no value was passed
  • previous flags if a new value was passed

◆ Send()

_.Library.Integer Send ( _.Library.String  item)
static

Send items to the output stream.



Each argument of this method is evaluated as an expression and the resulting value is framed (i.e. as a $List item) and added to the device buffer. When adding a framed item to the buffer, if there's not enough space, the previous contents of the buffer are flushed and the operation continues. If any individual item is longer than the buffer size, its frame will be sent with as many intermediate flushes as necessary. In the end, one or more items can remain in the buffer. To have them sent will require an extra flush.

Parameters: one or more ObjectScript expressions<br>
Return:

  • 0 if there was no intermediate flush
  • 1 otherwise

◆ SendFlush()

_.Library.Integer SendFlush ( _.Library.String  item)
static

Send items to the output stream and flush the buffer.



This method is like Send() followed by a buffer flush. Calling it without arguments just causes the flush.

Parameters: zero or more ObjectScript expressions<br>
Return: 1

◆ SendRequest()

_.Library.Integer SendRequest ( _.Library.Integer  msgid,
_.Library.Integer  contxt,
_.Library.Integer  opcode,
_.Library.String  item 
)
static

Send a Native DB request to the output stream.



Send a message to the server requesting the execution of the given opcode. The first two arguments, msgid and contxt, are integers that identify the message and the context. The method puts these two integers unchanged in the header. The third argument is an integer that identifies the request (the opcode).

The following arguments, item1, item2, ..., are optional and depend on the opcode. If present they are wrapped as regular $List() items and sent to the server as if by $System.OS.Send(item1, item2, ...). However, in this case, the length field of the header contains the number of bytes that the arguments occupy. If length is zero it means that no arguments were sent and the header contains all the information that the opcode needs.

Parameters:
msgid - message id (val1 in header).
contxt - context (val2 in header).
code - op code.
item... - zero or more ObjectScript expressions

Return: 0

◆ StartLog()

_.Library.Integer StartLog ( _.Library.Integer  flags)
static

Start logging to file "sysio_pid.log".



Parameters:
flags Optional initial log flags (bit values can be added):

  • 1 - Raw input
  • 2 - Raw output
  • 4 - IS.Execute() received opcodes

The default is 3 (raw input + raw output).

Return:

  • 0 - success
  • -1 - logging was already enabled
  • -2 - could not open log file

◆ StopLog()

_.Library.Integer StopLog ( )
static

Stop logging and close file "sysio_pid.log".



Return: 0