Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Struggling to reverse engineer javascript websocket in Corona SDK. Not great at networking.
Started by ssutherland Jan 04 2014 08:36 PM

5 replies to this topic
networking javascript websockets socket
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Starter
  • PipPipPipPipPipPip
  • 56 posts
  • Jedi

I am attempting to reverse engineer a web socket library in for Corona SDK.  I am not very familiar with networking, which I think is my problem.  Are there any good tutorials that can help me understand how web sockets work in Javascript and how I can make something analogous in Lua?

 

Thanks,

Scot



[TOPIC: post.html]
#2

marvinawilson

[GLOBAL: userInfoPane.html]
marvinawilson
  • Starter
  • PipPip
  • 15 posts
  • Member

This is very very hard.  We've asked Corona to include it here http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/3924658-websockets but there has been really no traction.

 

The difficulty is in the encoding which is easy to do in C or C++ but very difficult in Lua.  There are partial Lua solutions but they all use C++ underneath.  For example here: https://github.com/lipp/lua-websockets

 

I haven't found a complete solution so my own project is completely stuck.

 

 



[TOPIC: post.html]
#3

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Starter
  • PipPipPipPipPipPip
  • 56 posts
  • Jedi

This is very very hard.  We've asked Corona to include it here http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/3924658-websockets but there has been really no traction.

 

The difficulty is in the encoding which is easy to do in C or C++ but very difficult in Lua.  There are partial Lua solutions but they all use C++ underneath.  For example here: https://github.com/lipp/lua-websockets

 

I haven't found a complete solution so my own project is completely stuck.

I am really new to Conrona SDK but very experienced in software development (30+ years).  My focus has always been user interfaces for educational purposes so I have largely left the networking to others.

 

I've got Lua talking to a UDP server, which is nice and quick.  Is Lua is really c, c++ underneath?  Would it make more sense to call c library for this anyway?  Do you think it would be possible to make a deal with Corona Labs to develop this functionality?



[TOPIC: post.html]
#4

jack95

[GLOBAL: userInfoPane.html]
jack95
  • Starter
  • PipPipPipPipPipPip
  • 120 posts
  • Jedi

check out my websocket implementation http://github.com/jack9/pusherhub that works with pusher.com

 

It's not trivial, but totally possible to make websockets work (you have all the tools you need in lua).



[TOPIC: post.html]
#5

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Starter
  • PipPipPipPipPipPip
  • 56 posts
  • Jedi

Thanks Jack.  I'll take a look at your implementation.  We've gone in another direction for the moment, but I would like to revisit this later. As I began to dig into it I came to the conclusion it could be done.  It is nice to see an actual implementation.  I'm sure that will be very helpful.

 

May be back to this topic later.  Hopefully others will find this post.

 

Thanks,

--Scot

 



[TOPIC: post.html]
#6

dmccuskey

[GLOBAL: userInfoPane.html]
dmccuskey
  • Pro
  • PipPipPipPipPipPip
  • 133 posts
  • Jedi

i have published a library module to support WebSockets in Corona.
 
 
cheers,
dmc
 



[topic_controls]
[/topic_controls]



Also tagged with one or more of these keywords: networking, javascript, websockets, socket