%SYSTEM.OS
Class %SYSTEM.OS Extends %SYSTEM.Help [ System = 4 ]
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.
Methods
Send
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
SendRequest
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
SendFlush
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
Clear
ClassMethod Clear() As %Integer
Remove any data remaining in the output stream buffer.
Return: 0
StartLog
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
StopLog
ClassMethod StopLog() As %Integer
Stop logging and close file "sysio_pid.log".
Return: 0
LogFlags
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