Because of the "Maximum Number of Simultaneous TCP Connection: 1" I would like to close the connection after sending the command so I can use both iRule and voxcommando to control my receiver.
Sending single tcp writes to irule to control my ir lights and so on works every time.
In order to get feedback reliably using tcp.client you must specify the correct terminator when creating the client.
Would that be \x0D\x0A in my case?
Because I have tried that, made no difference.
I also tried client.connect -> client.write -> vc.pause for 10s -> client.disconnect
Made no difference compared to closing the connection directly after sending command using default 10ms delay.
Another thing I noticed is that the feedback event from the receiver is received when closing the connection.
If I add delays like you can see below the feedback event is received first when delays are done and its about to disconnect.
Also after full restart of voxcommando the first command to receiver ALWAYS(even feedback) works.
Quick restart does not guarantee this.
A couple of different logs:
After full restart with a delay of 5s on the command it self.
Two feedback events from receiver as you can see, first one has a payload, second does not.
2013-11-22 09:37:00 27 doCommand:test
2013-11-22 09:37:00 27 action repeat set to: 1
2013-11-22 09:37:00 27 Action: Tcp.Client.Connect - test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:37:00 27 [action] Tcp.Client.Connect:test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:37:00 27 [plugin] TcpMic: Not using message termination byte!
2013-11-22 09:37:00 27 [plugin] TcpMic: New thread created for client: test
2013-11-22 09:37:00 27 [vcevent] TCP.StartListen.test
2013-11-22 09:37:00 27 action repeat set to: 1
2013-11-22 09:37:00 27 Action: Tcp.Client.Write - test&&@MAIN:VOL=?\x0D\x0A&&5000
2013-11-22 09:37:00 27 [action] Tcp.Client.Write:test&&@MAIN:VOL=?\x0D\x0A&&5000
2013-11-22 09:37:05 32 [vcevent] testEvent
2013-11-22 09:37:05 32 doCommand:testOSD
2013-11-22 09:37:05 32 action repeat set to: 1
2013-11-22 09:37:05 32 Action: OSD.ShowText - Payload: @MAIN:VOL=-25.5\x0D\x0A
2013-11-22 09:37:05 32 [action] OSD.ShowText:Payload: @MAIN:VOL=-25.5\x0D\x0A
2013-11-22 09:37:05 32 action repeat set to: 1
2013-11-22 09:37:05 32 Action: TCP.Client.Disconnect - test
2013-11-22 09:37:05 32 [action] TCP.Client.Disconnect:test
2013-11-22 09:37:05 32 [vcevent] testEvent
2013-11-22 09:37:05 32 doCommand:testOSD
2013-11-22 09:37:05 32 action repeat set to: 1
2013-11-22 09:37:05 32 Action: OSD.ShowText - Payload:
2013-11-22 09:37:05 32 [action] OSD.ShowText:Payload:
2013-11-22 09:37:05 32 [vcevent] TCP.EndListenLoop.test
Same as above but without full restart of voxcommando.
Two events received again but this time both were empty.
2013-11-22 09:43:04 553 doCommand:test
2013-11-22 09:43:04 553 action repeat set to: 1
2013-11-22 09:43:04 553 Action: Tcp.Client.Connect - test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:43:04 553 [action] Tcp.Client.Connect:test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:43:04 553 [plugin] TcpMic: Not using message termination byte!
2013-11-22 09:43:04 553 [plugin] TcpMic: New thread created for client: test
2013-11-22 09:43:04 553 [vcevent] TCP.StartListen.test
2013-11-22 09:43:04 553 action repeat set to: 1
2013-11-22 09:43:04 553 Action: Tcp.Client.Write - test&&@MAIN:VOL=?\x0D\x0A&&5000
2013-11-22 09:43:04 553 [action] Tcp.Client.Write:test&&@MAIN:VOL=?\x0D\x0A&&5000
2013-11-22 09:43:09 545 [vcevent] testEvent
2013-11-22 09:43:09 545 doCommand:testOSD
2013-11-22 09:43:09 545 action repeat set to: 1
2013-11-22 09:43:09 545 Action: OSD.ShowText - Payload:
2013-11-22 09:43:09 545 [action] OSD.ShowText:Payload:
2013-11-22 09:43:09 545 action repeat set to: 1
2013-11-22 09:43:09 545 Action: TCP.Client.Disconnect - test
2013-11-22 09:43:09 545 [action] TCP.Client.Disconnect:test
2013-11-22 09:43:09 545 focused: VoxCommando
2013-11-22 09:43:09 545 [vcevent] unFocused.chrome
2013-11-22 09:43:09 545 [vcevent] focused.VoxCommando
2013-11-22 09:43:09 545 [vcevent] testEvent
2013-11-22 09:43:09 545 doCommand:testOSD
2013-11-22 09:43:09 545 action repeat set to: 1
2013-11-22 09:43:09 545 Action: OSD.ShowText - Payload:
2013-11-22 09:43:09 545 [action] OSD.ShowText:Payload:
2013-11-22 09:43:09 545 [vcevent] TCP.EndListenLoop.test
Removed all added delays(full restart)
As you can see only one event received and it contains correct payload
2013-11-22 09:45:22 755 doCommand:test
2013-11-22 09:45:22 755 action repeat set to: 1
2013-11-22 09:45:22 755 Action: Tcp.Client.Connect - test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:45:22 755 [action] Tcp.Client.Connect:test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:45:22 755 [plugin] TcpMic: Not using message termination byte!
2013-11-22 09:45:22 755 [plugin] TcpMic: New thread created for client: test
2013-11-22 09:45:22 755 [vcevent] TCP.StartListen.test
2013-11-22 09:45:22 755 action repeat set to: 1
2013-11-22 09:45:22 755 Action: Tcp.Client.Write - test&&@MAIN:VOL=?\x0D\x0A
2013-11-22 09:45:22 755 [action] Tcp.Client.Write:test&&@MAIN:VOL=?\x0D\x0A
2013-11-22 09:45:22 755 action repeat set to: 1
2013-11-22 09:45:22 755 Action: TCP.Client.Disconnect - test
2013-11-22 09:45:22 755 [action] TCP.Client.Disconnect:test
2013-11-22 09:45:22 755 [vcevent] testEvent
2013-11-22 09:45:22 755 doCommand:testOSD
2013-11-22 09:45:22 755 action repeat set to: 1
2013-11-22 09:45:22 755 Action: OSD.ShowText - Payload: @MAIN:VOL=-25.5\x0D\x0A
2013-11-22 09:45:22 755 [action] OSD.ShowText:Payload: @MAIN:VOL=-25.5\x0D\x0A
2013-11-22 09:45:22 755 [vcevent] TCP.EndListenLoop.test
Second time without full restart
This time feedback empty
2013-11-22 09:46:40 413 doCommand:test
2013-11-22 09:46:40 413 action repeat set to: 1
2013-11-22 09:46:40 413 Action: Tcp.Client.Connect - test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:46:40 413 [action] Tcp.Client.Connect:test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:46:40 413 [plugin] TcpMic: Not using message termination byte!
2013-11-22 09:46:40 413 [plugin] TcpMic: New thread created for client: test
2013-11-22 09:46:40 413 [vcevent] TCP.StartListen.test
2013-11-22 09:46:40 413 action repeat set to: 1
2013-11-22 09:46:40 413 Action: Tcp.Client.Write - test&&@MAIN:VOL=?\x0D\x0A
2013-11-22 09:46:40 413 [action] Tcp.Client.Write:test&&@MAIN:VOL=?\x0D\x0A
2013-11-22 09:46:40 413 action repeat set to: 1
2013-11-22 09:46:40 413 Action: TCP.Client.Disconnect - test
2013-11-22 09:46:40 413 [action] TCP.Client.Disconnect:test
2013-11-22 09:46:40 413 [vcevent] testEvent
2013-11-22 09:46:40 413 doCommand:testOSD
2013-11-22 09:46:40 413 action repeat set to: 1
2013-11-22 09:46:40 413 Action: OSD.ShowText - Payload:
2013-11-22 09:46:40 413 [action] OSD.ShowText:Payload:
2013-11-22 09:46:40 413 [vcevent] TCP.EndListenLoop.test
Here is a log with the use of vc.pause after write instead of built in delay in write action.
sent command twise, first time I got feedback correctly, second time I did not.
Only quick restart this time, quick restart does not guarantee correct result on first try as full restart does, just "luck" I guess.
2013-11-22 09:49:21 874 doCommand:test
2013-11-22 09:49:21 874 action repeat set to: 1
2013-11-22 09:49:21 874 Action: Tcp.Client.Connect - test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:49:21 874 [action] Tcp.Client.Connect:test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:49:21 874 [plugin] TcpMic: Not using message termination byte!
2013-11-22 09:49:21 874 [plugin] TcpMic: New thread created for client: test
2013-11-22 09:49:21 874 [vcevent] TCP.StartListen.test
2013-11-22 09:49:21 874 action repeat set to: 1
2013-11-22 09:49:21 874 Action: Tcp.Client.Write - test&&@MAIN:VOL=?\x0D\x0A
2013-11-22 09:49:21 874 [action] Tcp.Client.Write:test&&@MAIN:VOL=?\x0D\x0A
2013-11-22 09:49:21 874 [action] 09:49 VC.Pause: 5000
2013-11-22 09:49:26 896 [vcevent] testEvent
2013-11-22 09:49:26 896 doCommand:testOSD
2013-11-22 09:49:26 896 action repeat set to: 1
2013-11-22 09:49:26 896 Action: TCP.Client.Disconnect - test
2013-11-22 09:49:26 896 [action] TCP.Client.Disconnect:test
2013-11-22 09:49:26 896 action repeat set to: 1
2013-11-22 09:49:26 896 Action: OSD.ShowText - Payload: @MAIN:VOL=-25.5\x0D\x0A
2013-11-22 09:49:26 896 [action] OSD.ShowText:Payload: @MAIN:VOL=-25.5\x0D\x0A
2013-11-22 09:49:26 896 [vcevent] TCP.EndListenLoop.test
2013-11-22 09:49:38 706 doCommand:test
2013-11-22 09:49:38 706 action repeat set to: 1
2013-11-22 09:49:38 706 Action: Tcp.Client.Connect - test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:49:38 706 [action] Tcp.Client.Connect:test&&192.168.0.4&&50000&&&&testEvent
2013-11-22 09:49:38 706 [plugin] TcpMic: Not using message termination byte!
2013-11-22 09:49:38 706 [plugin] TcpMic: New thread created for client: test
2013-11-22 09:49:38 706 [vcevent] TCP.StartListen.test
2013-11-22 09:49:38 706 action repeat set to: 1
2013-11-22 09:49:38 706 Action: Tcp.Client.Write - test&&@MAIN:VOL=?\x0D\x0A
2013-11-22 09:49:38 706 [action] Tcp.Client.Write:test&&@MAIN:VOL=?\x0D\x0A
2013-11-22 09:49:38 706 [action] 09:49 VC.Pause: 5000
2013-11-22 09:49:43 744 [vcevent] testEvent
2013-11-22 09:49:43 744 doCommand:testOSD
2013-11-22 09:49:43 744 action repeat set to: 1
2013-11-22 09:49:43 744 Action: TCP.Client.Disconnect - test
2013-11-22 09:49:43 744 [action] TCP.Client.Disconnect:test
2013-11-22 09:49:43 744 action repeat set to: 1
2013-11-22 09:49:43 744 Action: OSD.ShowText - Payload:
2013-11-22 09:49:43 744 [action] OSD.ShowText:Payload:
2013-11-22 09:49:43 744 [vcevent] TCP.EndListenLoop.test