NewManLiving
10 years agoVisitor
Using ECP as a PostMessage replacement
In event-driven environments, the lack of a Post/Send-Message or a method to broadcast from asynchronous event handlers to a listener may lead to the use of ECP, as is already the case when one wants to implement a pseudo screensaver in an roScreen environment. The following function will broadcast to a listener who has created a roInput object and listens on the roInputEvent. In my experience URL encoding the arguments under these conditions will cause a return code of 404, also setting the header with the
"X-Roku-Reserved-Dev-Id", disabled my Development environment on all subsequent side-loading, until a reboot of the device (ROKU 3 )
Is it Ok to use this ( Joel, Mark ? ), and/or is there a plan with firmware 7 to allow internal communication with message ports. I am aware that one can call the event handler with the message and block until it returns with some type of return code. However, it is far more efficient in the case where there may be a rush of events such as the arrival of many texture events, to just pass off the event to the handler without blocking and let it decide if something is wrong, and if so simply to broadcast a message
"X-Roku-Reserved-Dev-Id", disabled my Development environment on all subsequent side-loading, until a reboot of the device (ROKU 3 )
Is it Ok to use this ( Joel, Mark ? ), and/or is there a plan with firmware 7 to allow internal communication with message ports. I am aware that one can call the event handler with the message and block until it returns with some type of return code. However, it is far more efficient in the case where there may be a rush of events such as the arrival of many texture events, to just pass off the event to the handler without blocking and let it decide if something is wrong, and if so simply to broadcast a message
Function channel_post_message( a_message As String ) As Boolean
'"format of a_message: resend.count=50&timeout.milliseconds=15000"
l_utr = CreateObject( "roUrlTransfer" )
l_utr.SetUrl( "http://" + m.IPAddress + ":8060/input?" + a_message )
return ( l_utr.PostFromString( "" ) = 200 )
End Function