Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

ANN: dmc_websockets - WebSocket module for Corona SDK
Started by dmccuskey May 14 2014 01:11 PM

25 replies to this topic
websockets networking
[TOPIC CONTROLS]
Page 1 of 2 1 2
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

dmccuskey

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

i just published a WebSocket module to my Corona repo at github. it's one of the tools i needed for a project i'm working on, so decided to share it with the community.
 
i tested the performance a few days ago and was getting ~2-3KB/s throughput – the example i have showed the data updates reflected in a scrollable list (scrolling smoothly). soon i'll post the code for this performance example in the github repo along with the other example currently there.
 
that throughput is fast enough for my project, however i'm sure it could be faster. unfortunately Corona SDK doesn't include any of the binary processing libraries (bit or lpack), so everything is being manipulated in Lua. :(
it would be awesome if CoronaLabs or someone in the community added these two libraries to the Plugins area so that we could supercharge low-level binary protocols ! :)
 
if you're interested to know more:
 
 
happy coding !
 
dmc
 
ps, i actually wrote this to support a library module for WAMP (http://wamp.ws) – a Corona WAMP client is really the Holy Grail for my project. i'm going to start coding soon...
 

 



[TOPIC: post.html]
#2

Gremlin Interactive

[GLOBAL: userInfoPane.html]
Gremlin Interactive
  • Enterprise
  • PipPipPipPipPipPip
  • 700 posts
  • Jedi

If i understand you correctly, your looking for a bit library? If so, have you seen this? http://docs.coronalabs.com/daily/plugin/bit/

[TOPIC: post.html]
#3

dmccuskey

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

sweet ! i just looked over the plugins last week and must have gone right past it.

 

thank you for letting me know. i'm going to integrate it ASAP !

 

cheers,

dmc



[TOPIC: post.html]
#4

Gremlin Interactive

[GLOBAL: userInfoPane.html]
Gremlin Interactive
  • Enterprise
  • PipPipPipPipPipPip
  • 700 posts
  • Jedi

sweet ! i just looked over the plugins last week and must have gone right past it.

thank you for letting me know. i'm going to integrate it ASAP !

cheers,
dmc


Welcome :)

Also, thanks for sharing this library!

[TOPIC: post.html]
#5

dmccuskey

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

i integrated the 'bit' plugin into the websocket lib and then ran a simple test to see how much faster it ran. looks like the plugin is around 20% faster. w00t !



[TOPIC: post.html]
#6

Gremlin Interactive

[GLOBAL: userInfoPane.html]
Gremlin Interactive
  • Enterprise
  • PipPipPipPipPipPip
  • 700 posts
  • Jedi

i integrated the 'bit' plugin into the websocket lib and then ran a simple test to see how much faster it ran. looks like the plugin is around 20% faster. w00t !


Glad it helped :)

[TOPIC: post.html]
#7

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

Hi,

 

Ready to implement dmc_websockets. Starting a new project.

 

 

I have installed the files and directories per docs.  The following are in the root directory.

 

dmc_corona (folder)

dmc_corona.cfg

dmc_corona_boot.lua

 

At the moment the main.lua file is really simple:

 

local storyboard = require "storyboard"

local WebSockets = require 'dmc_library.dmc_websockets' 

I get the following error:

 

File: module 'dmc_library.dmc_websockets' not found
Module 'dmc_library.dmc_websockets' not found:resource (dmc_library.dmc_websockets.lu) does not exist in archive

 

I am working as a Starter for the moment.  Is that my problem?

 

Thanks,

--Scot



[TOPIC: post.html]
#8

dmccuskey

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

hey Scot,

 

the websockets import should be:

local WebSockets = require 'dmc_corona.dmc_websockets'

(i.e., dmc_corona instead of dmc_library, according to how you've organized the project)

 

i'll check the docs to make sure that all of that is correct, i might have missed something after the library name change.

 

cheers, dmc



[TOPIC: post.html]
#9

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

That did the trick.  Thanks.

 

I'm connecting to a pretty wonky setup through the web socket.  The "server" is actually a NetLogo model and HubNet networking with a web socket extension.  I don't have the complete picture of what is happening on the other end.  So there is some reverse engineering required.

 

Here's what know.  

 

All data to/from the server is JSON encoded.  It looks as if your library uses JSON.  Correct?

 

There is some sort of handshaking sequence taking place.  All I have to go on is a Javascript implementation of a client, so I will be attempting to mirror that sequence through the websocket.

 

Any thoughts or gotcha's that come to mind would be helpful to know.

 

Looks great so far.



[TOPIC: post.html]
#10

dmccuskey

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

hey Scot,

 

the websocket protocol supports text or binary data – so yes, JSON works as text but it's not a "native" data type, which means that you'll have to encode/decode JSON yourself when you send/receive messages.

 

as long as you can reverse-engineer the JSON protocol and implement in your code, websockets will take care of transporting the JSON strings.

 

cheers, dmc



[TOPIC: post.html]
#11

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

Still struggling.

local WebSocket = require "dmc_corona.dmc_websockets"

local ws = WebSocket:new({uri = "192.168.1.73:9999"})

ws:send("NetLogo 5.0.2")

Getting:

 

2014-08-15 18:50:00.255 Corona Simulator[3869:507] Runtime error

/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_sockets/async_tcp.lua:191: calling 'send' on bad self (tcp{client} expected, got userdata)

stack traceback:

[C]: in function 'send'

/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_sockets/async_tcp.lua:191: in function 'send'

/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:660: in function '_sendFrame'

/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:775: in function '_processMessageQueue'

/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:747: in function '_addMessageToQueue'

/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:737: in function '_sendMessage'

/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:727: in function '_sendText'

/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:336: in function 'send'

/Users/scotsoutherland/Documents/Development/Websocket/main.lua:13: in main chunk



[TOPIC: post.html]
#12

dmccuskey

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

hi Scot,

 

everything is asynchronous, so you have to wait until the websocket is connected to send any data. because WebSocket:new() doesn't block, what you have written will try to send a message right away without ensuring there is a connection available.

 

to better understand the required async-connection flow, i would take a look at the examples which are in the library. i think the simple 'echo' example would make a good starting point for any app. 

 

hth, dmc



[TOPIC: post.html]
#13

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

Yep, that helps.  Looks like everything needs to happen in the event loop on the client side.  Had to compile a new NetLogo extension on the Java side (scala).  Now I have an active port on the other end and I'm getting an ONOPEN event.  So the socket object seems to be "real" now.

 

Looks like your part is working as designed.  Great stuff!  Thanks.  Took a look at doing this myself about 6 months ago.  SOOOOO glad you did it for us.

 

Now for the undocumented handshaking with HubNet.

 

Thanks,

--Scot



[TOPIC: post.html]
#14

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

Sending a JSON string and getting and ONERROR event.  Does the the event table contain any information besides type = "ONERROR"?  

 

The API docs on your site indicate this is due to a communication error.  Could this be a response from the server that the message does not make sense, or does this mean that the message never made it to the server?  Or is there a difference.

 

Thanks,

--Scot



[TOPIC: post.html]
#15

dmccuskey

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

there is a flag near the top of dmc_websockets.lua, called LOCAL_DEBUG. set to *true* will print out more info regarding the communication process to give a better idea when things go badly. tcp.lua and async_tcp.lua have the same.

 

usually there will be additional info in the event table on an error – properties 'code' and 'reason'. are you seeing a traceback along with the error ?

 

i'm not sure when you grabbed your copy of the library. i know i have made some updates recently which output more information in certain error conditions. i have also published other updates within the past few days.

 

 

if a server doesn't understand something it is supposed to close the connection cleanly with an error code/reason, not just drop it. of course, that'll depend on the WS implementation of the server code. :)

as far as onError, there isn't a lot in the WS spec regarding when to throw that, i am thinking the only reasons to throw that would be an 1. internal error (like some Lua issue) or 2. the network connection was suddenly lost.

 

 

cheers,

dmc

 

ps, if you're still having issues, i can take a look at your project if you are able to send it to me.



[TOPIC: post.html]
#16

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

Thanks dmc,

 

Working with the developer of the NetLogo Extension now.  He may have some insight as well.  I appreciate the offer and I will send the code along as it becomes necessary.  

 

Thanks for your work, your thoughts and your help.

 

--Scot



[TOPIC: post.html]
#17

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

Here's what I get:

 

2014-08-16 20:21:57.660 Corona Simulator[5220:507] {"type":"VersionMessage","fields":{"version":"NetLogo 5.0.4"}}
2014-08-16 20:21:57.661 Corona Simulator[5220:507] string
2014-08-16 20:21:57.661 Corona Simulator[5220:507] Received event: ONOPEN
2014-08-16 20:21:57.661 Corona Simulator[5220:507] 
 
dmc_websockets :: Unknown Error /Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/lua_objects.lua:440: attempt to index local 'params' (a string value)
2014-08-16 20:21:57.661 Corona Simulator[5220:507] stack traceback:
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:605: in function '_receiveFrame'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:960: in function 'do_state_connected'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:931: in function '__curr_state_func'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/lua_states.lua:96: in function 'gotoState'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:459: in function '_handleHttpRespose'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:921: in function 'do_state_http_negotiation'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:896: in function '__curr_state_func'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/lua_states.lua:96: in function 'gotoState'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:1119: in function 'callback'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_sockets/async_tcp.lua:216: in function 'receive'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:1126: in function </Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_websockets.lua:1081>
(tail call): ?
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_sockets/async_tcp.lua:400: in function '_doAfterReadAction'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_sockets/tcp.lua:383: in function '_readStatus'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_sockets.lua:435: in function '_checkConnections'
/Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_sockets.lua:461: in function </Users/scotsoutherland/Documents/Development/Websocket/dmc_corona/dmc_sockets.lua:458>
?: in function <?:221>
2014-08-16 20:21:57.662 Corona Simulator[5220:507] Received event: ONERROR


[TOPIC: post.html]
#18

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

Still working on the other end to try to understand what is happening.  The version number I sent is important for NetLogo, so if there is a mismatch, NLogo might be dropping the connection.  Still struggling to see what is happening on the other end.  Almost entirely undocumented except in the code, which is pretty tedious work.



[TOPIC: post.html]
#19

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

Seeing what's happening on the server side now.  Websocket opens and immediately closes.  The version number is not the issue.  Connection is not persisting.



[TOPIC: post.html]
#20

dmccuskey

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

a couple of days ago i pushed a fix for that error "attempt to index local 'params' (a string value)" – not sure when you last updated from github.

 

also on github near the top of the ReadMe i have listed a couple of ways you can PM me. you can use one of them to send me a zip of your code. i'd like to get you to a point where the connection is stable (or find out why it's not), then you can continue your work from there.

 

thanks, dmc



[TOPIC: post.html]
#21

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

Downloaded and installed your latest version.  Looks like that did it.  

 

Encoded and sent a JSON string and received a JSON string back.  Server side Java websocket persisting now as well.

 

Important step forward.  Thanks for all your support.  Will keep you posted.

 

Output as follows:

 

2014-08-17 15:27:40.542 Corona Simulator[5220:507] 

Copyright © 2009-2014  C o r o n a   L a b s   I n c .

2014-08-17 15:27:40.542 Corona Simulator[5220:507] Version: 3.0.0

2014-08-17 15:27:40.543 Corona Simulator[5220:507] Build: 2014.2393

2014-08-17 15:27:40.556 Corona Simulator[5220:507] Platform: iPhone / x86_64 / 10.9 / Intel HD Graphics 4000 OpenGL Engine / 2.1 INTEL-8.28.30 / 2014.2393

2014-08-17 15:27:40.628 Corona Simulator[5220:507] The file sandbox for this project is located at the following folder:

(/Users/scotsoutherland/Library/Application Support/Corona Simulator/Websocket-A7F64A150865B0DC24734D37DA1496ED)

2014-08-17 15:27:40.642 Corona Simulator[5220:507] Lua Patch::activating patch 'table-pop'

2014-08-17 15:27:40.643 Corona Simulator[5220:507] Lua Patch::activating patch 'string-format'

2014-08-17 15:27:40.649 Corona Simulator[5220:507] dmc_library:: Loading slower bitOp library

2014-08-17 15:27:40.753 Corona Simulator[5220:507] {"type":"VersionMessage","fields":{"version":"NetLogo 5.0.4"}}

2014-08-17 15:27:40.754 Corona Simulator[5220:507] Received event: ONOPEN

2014-08-17 15:27:40.754 Corona Simulator[5220:507] BufferErrorFactory Read surpasses buffer size

2014-08-17 15:27:40.764 Corona Simulator[5220:507] Received event: ONMESSAGE

2014-08-17 15:27:40.765 Corona Simulator[5220:507] {"type":"VersionMessage","fields":{"version":"NetLogo 5.0.4"}} text

2014-08-17 15:27:40.765 Corona Simulator[5220:507] BufferErrorFactory Read surpasses buffer size



[TOPIC: post.html]
#22

ssutherland

[GLOBAL: userInfoPane.html]
ssutherland
  • Pro
  • PipPipPipPipPipPip
  • 85 posts
  • Jedi

Hey dmc,

 

Just posting to verify that I was successful in reverse engineering the NetLogo Hubnet Protocol through the websocket.  We can now connect with NetLogo models via the Hubnet-Web extension.

 

Thanks for your help and your great work.

 

Best,

 

--Scot



[TOPIC: post.html]
#23

dmccuskey

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

hey Scot,

that's fantastic news ! i'm glad to hear that your project is going well. thanks for the kudos, too. :)

cheers, dmc

[TOPIC: post.html]
#24

olivier8

[GLOBAL: userInfoPane.html]
olivier8
  • Starter
  • Pip
  • 4 posts
  • Newbie

Hello,

 

My app works with websockets on corona simulator, but I soon as I build it and launch it on my iPhone6, I have the following error messages :

Oct  2 16:16:09 iPhone-de-olivier myapp[2241] <Warning>: Platform: iPhone / iPhone7,2 / 8.0.2 / Apple A8 GPU / OpenGL ES 2.0 Apple A8 GPU - 50.5.1 / 2014.2393
Oct  2 16:16:09 iPhone-de-olivier myapp[2241] <Warning>: Lua Patch::activating patch 'table-pop'
Oct  2 16:16:09 iPhone-de-olivier myapp[2241] <Warning>: Lua Patch::activating patch 'string-format'
Oct  2 16:16:09 iPhone-de-olivier myapp[2241] <Warning>: Runtime error
	/Library/WebServer/Documents/myapp/mobile/dmc_corona/dmc_websockets.lua:136: module 'dmc_sockets' not found in archive:
	/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/
	module 'dmc_sockets' not found:resource (dmc_sockets.lu) does not exist in archive
		no field package.preload['dmc_sockets']
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_sockets.lua'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_sockets.lua'
		no file './dmc_sockets.so'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_sockets.so'dmc_sockets
	/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_corona
	/Library/WebServer/Documents/myapp/mobile/dmc_corona/dmc_sockets.lua:130: module 'dmc_sockets.async_tcp' not found in archive:
	/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/
	module 'dmc_sockets.async_tcp' not found:resource (dmc_sockets.async_tcp.lu) does not exist in archive
		no field package.preload['dmc_sockets.async_tcp']
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_sockets.async_tcp.lua'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_sockets.async_tcp.lua'
		no file './dmc_sockets.async_tcp.so'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_sockets.async_tcp.so'
		no file './dmc_sockets.so'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_sockets.so'dmc_sockets.async_tcp
	/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_corona
	/Library/WebServer/Documents/myapp/mobile/dmc_corona/dmc_sockets/async_tcp.lua:53: module 'plugin.openssl' not found in archive:
	/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/
	module 'plugin.openssl' not found:resource (plugin.openssl.lu) does not exist in archive
		no field package.preload['plugin.openssl']
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/plugin.openssl.lua'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/plugin.openssl.lua'
		no file './plugin.openssl.so'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/plugin.openssl.so'
		no file './plugin.so'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/plugin.so'plugin.openssl
	/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_corona
	module 'dmc_corona.plugin.openssl' not found:resource (dmc_corona.plugin.openssl.lu) does not exist in archive
		no field package.preload['dmc_corona.plugin.openssl']
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_corona.plugin.openssl.lua'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_corona.plugin.openssl.lua'
		no file './dmc_corona.plugin.openssl.so'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_corona.plugin.openssl.so'
		no file './dmc_corona.so'
		no file '/private/var/mobile/Containers/Bundle/Application/AC5F1AFF-16AE-4CA2-BFF8-176AFDD3C516/myapp.app/dmc_corona.so'dmc_corona.plugin.openssl
	stack traceback:
		[C]: in function 'error'
		/Library/WebServer/Documents/myapp/mobile/dmc_corona_boot.lua:421: in function 'require'
		/Library/WebServer/Documents/myapp/mobile/dmc_corona/dmc_websockets.lua:136: in main chunk
		[C]: in function 'require'
		?: in function <?:803>
		(tail call): ?
		/Library/WebServer/Documents/myapp/mobile/main.lua:1: in main chunk

It occurs with the one and only require line :

local WebSockets = require 'dmc_corona.dmc_websockets'

 

Is this a bug, or is there anything I may have done wrong ? (it works very well on simulator).

 

Thanks,

 

Olivier



[TOPIC: post.html]
#25

dmccuskey

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

hi Olivier, thanks for putting this on github. i'm just going to continue this over there, but:

one thing i notice from the traceback is that the open SSL library isn't getting loaded. that comes from Corona Labs itself and is imported using the build.settings file. looking at the 'echo' example, it looks like the import for the SSL lib is missing from the build.settings file. :( i will update the example.

for now, you can look at the the settings file for the 'pusher' example and use that instead.


[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]



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