Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [%SYSTEM] >  [OS]
Private  Storage   

class %SYSTEM.OS extends %SYSTEM.Help

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 %SYSTEM.IS.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
7


Summary

Methods
Clear Help LogFlags Send SendFlush
SendRequest StartLog StopLog


Methods

• classmethod Clear() as %Integer
Remove any data remaining in the output stream buffer.

Return: 0
• classmethod LogFlags(flags As %Integer) as %Integer
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
• classmethod Send(item As %String) as %Integer
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

Return:
  • 0 if there was no intermediate flush
  • 1 otherwise
• classmethod SendFlush(item As %String) as %Integer
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

Return: 1
• classmethod SendRequest(msgid As %Integer, contxt As %Integer, opcode As %Integer, item As %String) as %Integer
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
• classmethod StartLog(flags As %Integer) as %Integer
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
• classmethod StopLog() as %Integer
Stop logging and close file "sysio_pid.log".

Return: 0


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.