I have a simple VB.net application that is starting on Windows boot. The purpose of the app is to send a string (My.settings.name) at a remote tcp Listener hosted on Node-Red I use Timer3 to recive string from TCP Listener I have tested the client and i was able to recive / send to another vb.net. The main question is how can i send string from NODE-RED TCP
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
If TCPClientStream.DataAvailable = True Then
Dim rcvbytes(TCPClientz.ReceiveBufferSize) As Byte
TCPClientStream.Read(rcvbytes, 0, CInt(TCPClientz.ReceiveBufferSize))
Dim msg As String = System.Text.Encoding.ASCII.GetString(rcvbytes)
MsgBox(msg)
End If
End Sub
This is the code is use to recive string on tcpclient in vb.net
[{"id":"aaed7ff9.1a39e","type":"debug","z":"a02a1902.30b3a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":350,"y":140,"wires":[]},{"id":"b9218dcd.c12b58","type":"tcp in","z":"a02a1902.30b3a8","name":"","server":"server","host":"","port":"1312","datamode":"stream","datatype":"utf8","newline":"[update]","topic":"","base64":false,"x":130,"y":120,"wires":[["aaed7ff9.1a39e"]]}]
This is code for tcp listener node and debug node.
Searched google the only option i saw was if i used node red as client , and use tcp request. Any way to do it otherway around ? Could a tcp server function be created ?
Okay , after some research i found a solution to my problem. First thing we have a tcp (input) listen node , in node settings, Outputs add the following: msg._session . TCP INPUT NODE SETTINGS
Second add a template node , in template node save the info you want to send to client. Third add a tcp (out) node , and change the type to Reply to tcp. TCP OUT NODE