PCE version 4C man_modulenamespaceid_tablemodified current_idOIxN class/streamN referenceC hash_tablerefersizeOIxNbothIsNV.stream.record_separatorCman_variable_card identifiermodule last_modifiednamesummary descriptionsee_alsoinheritdefaultsOIxNV.stream.record_separatorRICdateOIx2I Nrecord_separatornCstringOIx Regex that describes the record separator. When not @nil, the system will collect data from the stream until a complete record is available before calling the <-input_message. If the data arriving from the stream contains multiple records, the <-input_message will be called with each record separately. The default record separator is '\n' (newline), which implies that input is split into physical lines. If <-record_separator is an integer, the input is split into records of the indicated size. This is useful for receiving binary data that is organised in records. If you just want to collect all data from the process, it is advised to set the <-record_separator to @nil, disabling the input filtering. The ->record_separator may be changed on an open connection. Changing the record separator will immediately scan the data in the input buffer and dispatch any complete record according to the new definition. Setting the separator to @nil will run the <-input_message using the data in the buffer and destroy the buffer.nnnsNV.stream.rdstreamOIxNV.stream.rdstreamRIOIx.šNrdstreamnnnCchainsizeOIxIEN V.stream.rdfdXnsNC.streamCman_class_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherituser_interfacebugsOI xNC.streamRIOI x0NstreamnOI xClass stream is a super-class for the class process and class socket and provides methods for sending data to child processes and over sockets as well as handling (asynchronous) input from these objects. The most commonly used functionality of this class is: # ->format: Format text and send it to the stream # ->input_message: Handle input record # ->record_separator: Separate input in records (regex object)nnnnsNM.stream.S.inputCman_method_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherit diagnosticsdefaultsbugsOI xNM.stream.S.inputRIOI x0MvNinputnOIxoEnable input from file-descriptor. Assigns -rdfd and initialises input synchronisation with the Window System.nnnnnsNM.stream.S.appendOIxNM.stream.S.appendRIOIx.?NappendnOIxSend data to stream. The current implementation flushes the data automatically. Future releases may provide input buffering. See also ->newline, ->append_line and ->format.nnnnnsNM.stream.S.write_as_fileOIxNM.stream.S.write_as_fileRIOIx;N write_as_filenOIxVThis method allows pce_open/3 to open a socket in `append' mode, using Prolog's stream primitives to send data to an XPCE stream. For example: open(Socket, append, Stream), format(Socket, 'Hello World~n', []), close(Stream). Note: streams cannot be opened in mode `write' as they lack the required `source_sink->truncate_as_file' method.nnnnnsNM.stream.S.unlinkOIxNM.stream.S.unlinkRIOIx5}ONunlinknOIx>Closes the stream. See also ->close_input and ->close_output.nnnnnsNV.stream.input_messageOIxNV.stream.input_messageRIOIx9N input_messagenOIx[Each time a complete input record (see <-record_separator) is available, this code is executed with the following bindings: @receiver: the stream object @arg1: a string object holding the data Note: when using a socket object, the receiver of the ->input_message must be @receiver as the actual connections are running on a <-clone'ed socket.nnnsNM.stream.S.end_of_fileOIxNM.stream.S.end_of_fileRIOIx.5N end_of_filenOIxySent by the system when end-of-file is reached on the input. The default implementation just succeeds. May be redefined.nnnnnsNV.stream.input_allocatedOIxNV.stream.input_allocatedRIOIx.ľNinput_allocatednnnOI xIENV.stream.input_bufferXnsNV.stream.ws_refOI!xNV.stream.ws_refRIOI"x0MNws_refnOI#x%Window system synchronisation handle.nnnsNM.stream.G.read_lineOI$xNM.stream.G.read_lineRIOI%xend_of_file. The constant @nil is returned if no full line becomes available within `timeout' seconds. The granularity of timeout timing is system dependant. If the `timeout' is @default, this method blocks forever. Asynchronous input handling (using ->input_message) is the preferred way of handling process data.nnnnnsNV.stream.input_bufferOI'xNV.stream.input_bufferRIOI(x.YN input_buffernOI)xaBuffer to collect data from the stream into records. See <-record_separator and <-input_message.nnnsNM.stream.S.waitOI*xNM.stream.S.waitRIOI+x0oNwaitnOI,xLDispatches input events until the input is closed after reading end-of-file.nnnnnsNM.stream.S.initialiseOI-xNM.stream.S.initialiseRIOI.x0N initialisenOI/xCreates a stream object from the following arguments: # rfd [int] C-file-descriptor number for input. When left @default, this will be @nil, indicating input should not be monitored. # wfd [int] C-file-descriptor number for output. When left @default this will be @nil, indicating the stream cannot be written to. # input_message [code object] Code object for handling input. See <-input_message. # record_separator [regex object] Regular expression to split input stream into logical records. The default is '\n', splitting the input into physical lines. See <-record_separator. Class stream is designed to share code between class socket and class process. It may be used for other interaction, but all such application of this class is as yet unsupported.nnnnnsNM.stream.S.close_outputOI0xNM.stream.S.close_outputRIOI1x.N close_outputnnnOI2xIENM.stream.S.close_inputXnnnsNM.stream.S.close_inputOI3xNM.stream.S.close_inputRIOI4x.N close_inputnOI5xVCloses the associated file-descriptor -rdfd/-wrfd and deallocates the input buffering.nnnnnsN V.stream.rdfdOI6xN V.stream.rdfdRIOI7x0NrdfdnOI8xVOperating-system file-handles. -rdstream is a buffered handle using with <-read_line.nnnsNV.stream.input_pOI9xNV.stream.input_pRIOI:x.Ninput_pnnnOI;xIENV.stream.input_bufferXnsN V.stream.wrfdOIxIEN V.stream.rdfdXnXaCnumber O I?xx