Hello everyone, I have tried to open a pipe under Windows and write to it.
With PipeViewer - PipeChat (https://github.com/cyberark/PipeViewer/releases/tag/v.1.1) I managed the communication with the process successfully.
How do I open a pipe in B4J? I have searched the forum and found nothing suitable, I assumed that this is handled normally as asynchronous file access but I can't reproduce my results with PipeChat.
This is my code:
Nothing crashes but also nothing really happens.
Thanks, Chris
With PipeViewer - PipeChat (https://github.com/cyberark/PipeViewer/releases/tag/v.1.1) I managed the communication with the process successfully.
How do I open a pipe in B4J? I have searched the forum and found nothing suitable, I assumed that this is handled normally as asynchronous file access but I can't reproduce my results with PipeChat.
This is my code:
B4X:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private AStreams As AsyncStreams
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
Dim input As InputStream = File.OpenInput("\\.\pipe\","HmiRuntime")
Dim output As OutputStream = File.OpenOutput("\\.\pipe\","HmiRuntime",True)
AStreams.Initialize(input, output, "AStreams")
Dim buffer() As Byte
buffer = ("BrowseTags * 100 --filter *"&CRLF).GetBytes("UTF8")
AStreams.Write(buffer)
End Sub
Sub AStreams_NewData (Buffer() As Byte)
Dim msg As String
msg = BytesToString(Buffer, 0, Buffer.Length, "UTF8")
Log(msg)
End Sub
Nothing crashes but also nothing really happens.
Thanks, Chris