# Web sockets stops working after 6 commands

**URL:** <https://forum.line-us.com/t/web-sockets-stops-working-after-6-commands/413>\
**Category:** Programming and API\
**Created:** [March 13, 2019, 5:14pm UTC](https://forum.line-us.com/t/web-sockets-stops-working-after-6-commands/413 "2019-03-13T17:14:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonny5alive](https://forum.line-us.com/letter_avatar_proxy/v4/letter/j/f17d59/32.png) [@jonny5alive](https://forum.line-us.com/u/jonny5alive)\
**Post date:** [March 13, 2019, 5:14pm UTC](https://forum.line-us.com/t/web-sockets-stops-working-after-6-commands/413/1 "2019-03-13T17:14:24Z")

</div>

Hi

I’m using web sockets to connect to my Line Us, and send movement commands with GCode. The movements work, and I receive an ‘ok X:1000 Y:750 Z:0’ after each command. But after usually 6 commands, it stops responding. Any ideas? I’ve checked if the socket closes, but it is still open.

---

<div class="post-metadata">

**Author:** ![rob](https://forum.line-us.com/user_avatar/forum.line-us.com/rob/32/8_2.png) [@rob](https://forum.line-us.com/u/rob)\
**Post date:** [March 13, 2019, 6:35pm UTC](https://forum.line-us.com/t/web-sockets-stops-working-after-6-commands/413/2 "2019-03-13T18:35:56Z")

</div>

You need to read the responses, but it sounds like you’re doing that. Could you share some example code so I could take a look?

---

<div class="post-metadata">

**Author:** ![jonny5alive](https://forum.line-us.com/letter_avatar_proxy/v4/letter/j/f17d59/32.png) [@jonny5alive](https://forum.line-us.com/u/jonny5alive)\
**Post date:** [March 13, 2019, 6:36pm UTC](https://forum.line-us.com/t/web-sockets-stops-working-after-6-commands/413/3 "2019-03-13T18:36:41Z")

</div>

Thanks for the quick answer. I found the problem and fixed it. I wasn’t responding with an API response and the browser was limited to 6 sockets. =)

---

<div class="post-metadata">

**Author:** ![rob](https://forum.line-us.com/user_avatar/forum.line-us.com/rob/32/8_2.png) [@rob](https://forum.line-us.com/u/rob)\
**Post date:** [March 18, 2019, 12:22pm UTC](https://forum.line-us.com/t/web-sockets-stops-working-after-6-commands/413/4 "2019-03-18T12:22:42Z")

</div>

If you’re using Javascript I’d definitely recommend taking a look at [the javascript library](https://github.com/Line-us/Line-us-Programming#javascript-library-by-beardicus) created by Beardicus. It does a lot of the work for you!

---

<div class="post-metadata">

**Author:** ![jonny5alive](https://forum.line-us.com/letter_avatar_proxy/v4/letter/j/f17d59/32.png) [@jonny5alive](https://forum.line-us.com/u/jonny5alive)\
**Post date:** [March 18, 2019, 4:20pm UTC](https://forum.line-us.com/t/web-sockets-stops-working-after-6-commands/413/5 "2019-03-18T16:20:49Z")

</div>

Thanks, it’s a great library. I just wanted to learn it for myself.

---

<div class="post-metadata">

**Author:** ![rob](https://forum.line-us.com/user_avatar/forum.line-us.com/rob/32/8_2.png) [@rob](https://forum.line-us.com/u/rob)\
**Post date:** [March 18, 2019, 9:46pm UTC](https://forum.line-us.com/t/web-sockets-stops-working-after-6-commands/413/6 "2019-03-18T21:46:36Z")

</div>

I see - just been playing with it. Great fun!

---

<div class="post-metadata">

**Author:** ![jonny5alive](https://forum.line-us.com/letter_avatar_proxy/v4/letter/j/f17d59/32.png) [@jonny5alive](https://forum.line-us.com/u/jonny5alive)\
**Post date:** [March 18, 2019, 9:59pm UTC](https://forum.line-us.com/t/web-sockets-stops-working-after-6-commands/413/7 "2019-03-18T21:59:40Z")

</div>

Thanks, there is a good community growing there too.
