dmc-websocket - error when running

Hi, Hello

I have downloaded an example about websocket, and when I run it in Corona Simulator i have this error. And I dont know what to do. Can somebody help me.
 

An example is _ dms-websocket-echo _

Thank you for any help.

############################################## table: 0779D9B0 table: 0779D9B0 table: 077D8910 Lua Patch::activating patch 'string-format' Lua Patch::activating patch 'table-pop' Received event: ONOPEN === Sending 5 messages === Sending message (1): 'Current app time: 2118.3' ERROR: Read surpasses buffer size stack traceback: C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_error.lua:124: in function '\_\_new\_\_' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_class.lua:275: in function 'initializeObject' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_class.lua:476: in function \<C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_class.lua:469\> (tail call): ? C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_bytearray.lua:359: in function '\_checkAvailable' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_bytearray.lua:287: in function 'readBuf' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets\frame.lua:246: in function 'readFrameHeader' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets\frame.lua:441: in function 'receiveFrame' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:622: in function \<C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:621\> [C]: in function 'pcall' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_error.lua:79: in function 'try' ... C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_states\_mix.lua:177: in function 'gotoState' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:1168: in function 'callback' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets\async\_tcp.lua:306: in function 'receive' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:1175: in function \<C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:1143\> (tail call): ? C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets\async\_tcp.lua:473: in function '\_doAfterReadAction' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets\tcp.lua:401: in function '\_readStatus' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets.lua:453: in function '\_checkConnections' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets.lua:481: in function \<C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets.lua:478\> ?: in function \<?:205\> Received event: ONMESSAGE echoed message: 'Current app time: 2118.3' ERROR: Read surpasses buffer size stack traceback: C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_error.lua:124: in function '\_\_new\_\_' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_class.lua:275: in function 'initializeObject' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_class.lua:476: in function \<C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_class.lua:469\> (tail call): ? C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_bytearray.lua:359: in function '\_checkAvailable' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_bytearray.lua:287: in function 'readBuf' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets\frame.lua:246: in function 'readFrameHeader' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets\frame.lua:441: in function 'receiveFrame' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:622: in function \<C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:621\> [C]: in function 'pcall' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\lib\dmc\_lua\lua\_error.lua:79: in function 'try' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:620: in function '\_receiveFrame' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:1170: in function 'callback' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets\async\_tcp.lua:306: in function 'receive' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:1175: in function \<C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_websockets.lua:1143\> (tail call): ? C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets\async\_tcp.lua:473: in function '\_doAfterReadAction' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets\tcp.lua:401: in function '\_readStatus' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets.lua:453: in function '\_checkConnections' C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets.lua:481: in function \<C:\Users\przelew\Downloads\Corona SDK\dmc-websockets-master\examples\dmc-websockets-echo\dmc\_corona\dmc\_sockets.lua:478\> ?: in function \<?:205\> Sending message (2): 'Current app time: 2770.4' Received event: ONMESSAGE echoed message: 'Current app time: 2770.4'

Share the link to the code you downloaded so anyone who wants to help can run the code themselves.

You can send David an email,  corona-lib at davidmccuskey.com

Cheers.

Hello thank you for you reply.

Here is my image with my code organization:

http://postimg.org/image/71yr28403/

I have windows 7, 64 Bit, and I run it inside simulator - ver. 2016.2830

Here is a GitHub project :

https://github.com/dmccuskey/dmc-websockets

And here is project site:

http://docs.davidmccuskey.com/dmc-websockets

thank you

I will send email also today

We’d need to see some of your code to really be able to help but (without knowing anything about dmc-websockets) the error message would indicate you’re trying to read more data than you’ve allowed room for.

Try to boil things down to the minimum amount of code needed to trigger the error and post that code here.  The best place to start is probably one of the examples on Github: do they work?  How is your code different?

Hi Perry 

Problem is that I have run only examples on github repository, without changing any code.

here is my code example:

http://www.4shared.com/zip/kfm9dc0dce/dmc-websockets-echo.html

Im sorry for that site, it can contain some annoying advertisments, and downloading can be tricky but it works.

Greetings Przemek

I didn’t have any luck trying to download from that site.  I recommend you get a free account at https://www.dropbox.com and use that instead.

Ok, Perry I changed it :slight_smile:

https://www.dropbox.com/s/h4uv5hpkxi08qz3/dmc-websockets-echo.zip?dl=0

I ran that (after commenting out the require “CiderDebugger” ) and I got:

Mar 29 20:20:14.201 ############################################## Mar 29 20:20:14.247 Lua Patch::activating patch 'string-format' Mar 29 20:20:14.254 Lua Patch::activating patch 'table-pop' Mar 29 20:20:14.529 Received event: ONOPEN Mar 29 20:20:14.530 === Sending 5 messages === Mar 29 20:20:14.530 Sending message (1): 'Current app time: 460.7' Mar 29 20:20:14.630 Received event: ONMESSAGE Mar 29 20:20:14.630 echoed message: 'Current app time: 460.7' Mar 29 20:20:15.158 Sending message (2): 'Current app time: 1089.361' Mar 29 20:20:15.258 Received event: ONMESSAGE Mar 29 20:20:15.258 echoed message: 'Current app time: 1089.361' Mar 29 20:20:15.785 Sending message (3): 'Current app time: 1716.258' Mar 29 20:20:15.885 Received event: ONMESSAGE Mar 29 20:20:15.885 echoed message: 'Current app time: 1716.258' Mar 29 20:20:16.411 Sending message (4): 'Current app time: 2342.256' Mar 29 20:20:16.511 Received event: ONMESSAGE Mar 29 20:20:16.512 echoed message: 'Current app time: 2342.256' Mar 29 20:20:17.038 Sending message (5): 'Current app time: 2969.289' Mar 29 20:20:17.138 Received event: ONMESSAGE Mar 29 20:20:17.139 echoed message: 'Current app time: 2969.289' Mar 29 20:20:17.237 Received event: ONCLOSE Mar 29 20:20:17.237 code:reason 1000 Purpose for connection has been fulfilled

Not sure what I’m looking for.  If you haven’t tried running the code without the  require “CiderDebugger” , I recommend you do that.

Ok Perry, I have found an error . The problem was with Lua Glider IDE …
I had change to Sublime Text 2 and it works.

Thank you for your cooperation.

Share the link to the code you downloaded so anyone who wants to help can run the code themselves.

You can send David an email,  corona-lib at davidmccuskey.com

Cheers.

Hello thank you for you reply.

Here is my image with my code organization:

http://postimg.org/image/71yr28403/

I have windows 7, 64 Bit, and I run it inside simulator - ver. 2016.2830

Here is a GitHub project :

https://github.com/dmccuskey/dmc-websockets

And here is project site:

http://docs.davidmccuskey.com/dmc-websockets

thank you

I will send email also today

We’d need to see some of your code to really be able to help but (without knowing anything about dmc-websockets) the error message would indicate you’re trying to read more data than you’ve allowed room for.

Try to boil things down to the minimum amount of code needed to trigger the error and post that code here.  The best place to start is probably one of the examples on Github: do they work?  How is your code different?

Hi Perry 

Problem is that I have run only examples on github repository, without changing any code.

here is my code example:

http://www.4shared.com/zip/kfm9dc0dce/dmc-websockets-echo.html

Im sorry for that site, it can contain some annoying advertisments, and downloading can be tricky but it works.

Greetings Przemek

I didn’t have any luck trying to download from that site.  I recommend you get a free account at https://www.dropbox.com and use that instead.

Ok, Perry I changed it :slight_smile:

https://www.dropbox.com/s/h4uv5hpkxi08qz3/dmc-websockets-echo.zip?dl=0

I ran that (after commenting out the require “CiderDebugger” ) and I got:

Mar 29 20:20:14.201 ############################################## Mar 29 20:20:14.247 Lua Patch::activating patch 'string-format' Mar 29 20:20:14.254 Lua Patch::activating patch 'table-pop' Mar 29 20:20:14.529 Received event: ONOPEN Mar 29 20:20:14.530 === Sending 5 messages === Mar 29 20:20:14.530 Sending message (1): 'Current app time: 460.7' Mar 29 20:20:14.630 Received event: ONMESSAGE Mar 29 20:20:14.630 echoed message: 'Current app time: 460.7' Mar 29 20:20:15.158 Sending message (2): 'Current app time: 1089.361' Mar 29 20:20:15.258 Received event: ONMESSAGE Mar 29 20:20:15.258 echoed message: 'Current app time: 1089.361' Mar 29 20:20:15.785 Sending message (3): 'Current app time: 1716.258' Mar 29 20:20:15.885 Received event: ONMESSAGE Mar 29 20:20:15.885 echoed message: 'Current app time: 1716.258' Mar 29 20:20:16.411 Sending message (4): 'Current app time: 2342.256' Mar 29 20:20:16.511 Received event: ONMESSAGE Mar 29 20:20:16.512 echoed message: 'Current app time: 2342.256' Mar 29 20:20:17.038 Sending message (5): 'Current app time: 2969.289' Mar 29 20:20:17.138 Received event: ONMESSAGE Mar 29 20:20:17.139 echoed message: 'Current app time: 2969.289' Mar 29 20:20:17.237 Received event: ONCLOSE Mar 29 20:20:17.237 code:reason 1000 Purpose for connection has been fulfilled

Not sure what I’m looking for.  If you haven’t tried running the code without the  require “CiderDebugger” , I recommend you do that.

Ok Perry, I have found an error . The problem was with Lua Glider IDE …
I had change to Sublime Text 2 and it works.

Thank you for your cooperation.