
lkrocek
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2018
04:42 AM
TCP Socket client
Hi,
I need help. How I can create TCP socket client connection?
I read https://sdkdocs.roku.com/display/sdkdoc/roStreamSocket there is not much information in detail and if I am right first sample is a client so I should mix usage of both samples, so I tried it but from some reasons it takes really long time (at least 30 seconds) to receive first message from port, does anyone know where could be a problem?
Details:
I need help. How I can create TCP socket client connection?
I read https://sdkdocs.roku.com/display/sdkdoc/roStreamSocket there is not much information in detail and if I am right first sample is a client so I should mix usage of both samples, so I tried it but from some reasons it takes really long time (at least 30 seconds) to receive first message from port, does anyone know where could be a problem?
Details:
- I have Roku 3 with firmware version 8
- I use sample app
- I created and putted my own ComponentLibrary
- Created a Task component to make network connection working
- I code below putted into my task component:
port = CreateObject("roMessagePort")
connection = {}
sendAddress = CreateObject("roSocketAddress")
sendAddress.SetAddress("echo.websocket.org:80")' WebSocket test server -> http://www.websocket.org/echo.html '
sock = CreateObject("roStreamSocket")
sock.setMessagePort(port)
sock.SetSendToAddress(sendAddress)
sock.notifyReadable(true)
sock.Listen(3)
If not sock.eOK() then
print "socket error"
stop
End If
If sock.Connect()
Print "Connected Successfully"
Else
Print "Connection failed"
End If
while True
ssevent = port.WaitMessage(0)
if type(ssevent) = "roSocketEvent"
print "connection established from port"
end if
end while
Platforms integration specialist
====================
@ https://suite.st/
====================
@ https://suite.st/
4 REPLIES 4
acreskey
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2018
08:54 AM
Re: TCP Socket client
It looks like you are trying to connect the tcp socket to a websocket server, which is a problem.

lkrocek
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2018
12:11 AM
Re: TCP Socket client
found lib which is handling websocket, solved
Platforms integration specialist
====================
@ https://suite.st/
====================
@ https://suite.st/
acreskey
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2018
10:09 AM
Re: TCP Socket client
Thanks for sharing that.
Because this library doesn't support secure sockets (because roStreamSocket doesn't), a fully-implemented Roku WebSocket addition would still be useful.
Because this library doesn't support secure sockets (because roStreamSocket doesn't), a fully-implemented Roku WebSocket addition would still be useful.

lkrocek
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2018
02:39 AM
Re: TCP Socket client
Currently this library is working really nice on dev branch, but it has one uncomfortable issue which is a performance on slower devices, would be nice if someone help to solve it!
https://github.com/rolandoislas/BrightW ... -411021770
https://github.com/rolandoislas/BrightW ... -411021770
Platforms integration specialist
====================
@ https://suite.st/
====================
@ https://suite.st/