Facility Control

 View Only
  • 1.  sendTCPString with a Listener

    Posted 05-04-2020 19:20

    Hi everyone,

    Is there a way to write to a TCP listener like you can send "through" a UDP listener?

    var listener = ogscript.getListenerById('id');
    listener.writeString('str text I want to send', false);

    TypeError: Cannot find function writeString in object com.rossvideo.common.oglml.elementfactories.ListenerElementFactor

    I've tried various combos of listener.sendMessage, sendTCPString, etc. to no avail. Is this possible? I want to keep the data flowing through 1 open TCP connection so I don't want to use rosstalk.sendmessagewithResponse....

    I can send and receive using the this.writeString function inside the listener without issue.

    Going to tag <x-zendesk-user data-user-name="James Peltzer">372651266391</x-zendesk-user> as he seems to be the expert on these topics here...

    Thanks!

     



  • 2.  RE: sendTCPString with a Listener

    Posted 05-04-2020 23:27

    Yes, there is. I dont have a computer in front of me now, so some what harder to explain on a Phone...

    I kinda expect mr Peltzer to answer this one way before I get the chance to find my example. But yes, it should be possible, unless I confuse it with sending UDP messages through it, but that's basically the way you build the control panel for a BMD Hyperdeck if you want to parse the full response you get back from it. 


    #DashBoard


  • 3.  RE: sendTCPString with a Listener

    Posted 05-05-2020 01:31

    <x-zendesk-user data-user-name="Aleksander Stalsberg">372690297731</x-zendesk-user>

    Your post was just the hint I needed to find the answer on the forum.

    For future searches:

    You put the 'this' object of the listener into the global variables in the isconnectevent() and then get it whenever you want to send something. 

    so to send the message through the listener you stored use: 


    ogscript.getObject('device1').writeString('send this \r\n', false);

    https://support.rossvideo.com/hc/en-us/community/posts/360043165112-Declaring-a-parameter-inside-a-TCP-string-to-set-clip-name-on-Blackmagic-recorder-


    #DashBoard


  • 4.  RE: sendTCPString with a Listener

    Posted 05-05-2020 08:16

    Aaaahhh, lookie there, you found the posts I was thinking about last night but couldnt find on the Phone.

    Glad it helped! 😁


    #DashBoard


  • 5.  RE: sendTCPString with a Listener

    Posted 05-05-2020 21:15

    Hi All

    I've been in meetings most of the past 2 days so I'm a little behind on my forum reading. For reference, the reason for needing to expose the "this" object is that one listener can have many connections. The "this" object inside of a listener event is to interact with a single one of the listener's connections.

    Glad you were able to get it sorted out.

    James


    #DashBoard


  • 6.  RE: sendTCPString with a Listener

    Posted 05-05-2020 22:01

    Thanks James for chiming in! Its definitely the season of constant meetings.....

    So does the event object pass on any information about the inbound connection? I haven't thought of a good use for it yet, but I feel like there could be. 

    For example, event.getIPAddress. No rush on the reply. I was able to get the TCP listener to function just like I wanted. 

     


    #DashBoard


  • 7.  RE: sendTCPString with a Listener

    Posted 05-06-2020 14:12

    The event object has the following methods:
    consume()
    getBytes()
    getBytesAsString()
    getRemoteHost()
    getRemotePort()
    isConsumed()
    isConnectEvent()
    isDisconnectEvent()
    isMessageEvent()


    #DashBoard