<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="35555" data-post-id="35555">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Azolo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Azolo/120/2189_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Azolo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="michalmuskala" data-post="20" data-topic="4733">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/michalmuskala/48/20288_2.png" class="avatar"> michalmuskala:</div>
<blockquote>
<p>The fact that call is synchronous for the caller, does not mean it’s synchronous for the server. Using an explicit GenServer.reply/1 you can reply to the message before returning from the handle_call function, after or even from a completely different process.</p>
</blockquote>
</aside>
<aside class="quote no-group" data-username="sasajuric" data-post="21" data-topic="4733">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"> sasajuric:</div>
<blockquote>
<p>Just because your behaviour is internally powered by GenServer doesn’t mean it has to expose everything GenServer does. So for example, if the timeout option doesn’t make sense in WebSockex, you don’t need to support it in your own behaviour.</p>
</blockquote>
</aside>
<p>Hey <a class="mention" href="/u/michalmuskala" rel="nofollow">@michalmuskala</a> and <a class="mention" href="/u/sasajuric" rel="nofollow">@sasajuric</a>, thanks for the input. I feel like I understood what you’re saying at the time that I made my decision. But none of what I am thinking brings back a good enough reason to not use <code>GenServer</code>. Even if there was, in it’s current state <code>WebSockex</code> has no reason not to be a <code>GenServer</code>.</p>
<p>So I either completely forgot what it was I tried to avoid or I was wrong and my reasons weren’t good enough in the first place.</p>
<p>Let me think on it for a couple of days. If anything comes to mind, I’ll let you know.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35555" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/websockex-an-elixir-websocket-client/4733/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-35555" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35555"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="35562" data-post-id="35562">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Glancing at your code, one reason which comes to mind is that with async mode of connecting, you’ll invoke <code>init_ack</code> in the middle of your initialization. This is somewhat clumsy to support with GenServer, especially at the library level, when you’re not aware whether the server process will be named or not.</p>
<p>One solution might be to start the task from <code>init/1</code> which will establish the connection, perform the initial handshake, and then give the ownership to the parent with <a href="http://erlang.org/doc/man/gen_tcp.html#controlling_process-2" rel="nofollow">controlling_process</a>.</p>
<p>I’m not very familiar with websocket details, so maybe I’m missing some possible caveats, but I think this might take off. The main benefit here is that your initialization then becomes straightforward, because you don’t need to ack in the middle, and get to keep async connecting and handshake.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35562" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/websockex-an-elixir-websocket-client/4733/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-35562" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35562"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="37411" data-post-id="37411">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Azolo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Azolo/120/2189_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Azolo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<h2><a name="p-37411-websockex-030-released-1" class="anchor" href="#p-37411-websockex-030-released-1" aria-label="Heading link" rel="nofollow"></a>WebSockex 0.3.0 Released!</h2>
<h3><a name="p-37411-breaking-changes-2" class="anchor" href="#p-37411-breaking-changes-2" aria-label="Heading link" rel="nofollow"></a>Breaking Changes</h3>
<ul>
<li>The parameters for the <code>handle_connect/2</code> callback have been reversed. The order is now <code>(conn, state)</code>.</li>
</ul>
<h3><a name="p-37411-enhancements-3" class="anchor" href="#p-37411-enhancements-3" aria-label="Heading link" rel="nofollow"></a>Enhancements</h3>
<ul>
<li>Added initial connection timeouts. (<code>:socket_connect_timeout</code> and <code>:socket_recv_timeout</code>)
<ul>
<li>Can be used as <code>start</code> or <code>start_link</code> option or as a <code>Conn.new</code> option.</li>
<li><code>:socket_connect_timeout</code> - The timeout for opening a TCP connection.</li>
<li><code>:socket_recv_timeout</code> - The timeout for receiving a HTTP response header.</li>
</ul>
</li>
<li><code>start</code> and <code>start_link</code> can now take a <code>Conn</code> struct in place of a url.</li>
<li>Added the ability to handle system messages while opening a connection.</li>
<li>Added the ability to handle parent exit messages while opening a connection.</li>
<li>Improve <code>:sys.get_status</code>, <code>:sys.get_state</code>, <code>:sys.replace_state</code> functions.
<ul>
<li>These are undocumented, but are meant primarily for debugging.</li>
</ul>
</li>
</ul>
<h3><a name="p-37411-bug-fixes-4" class="anchor" href="#p-37411-bug-fixes-4" aria-label="Heading link" rel="nofollow"></a>Bug Fixes</h3>
<ul>
<li>Ensure <code>terminate/2</code> callback is called consistently.</li>
<li>Ensure when termination when a parent exit signal is received.</li>
<li>Add the <code>system_code_change</code> function so that the <code>code_change</code> callback is actually used.</li>
</ul>
<p>Take a look at the <a href="https://github.com/Azolo/websockex/compare/v0.2.0...v0.3.0" rel="noopener nofollow ugc"><code>v0.2.0..v0.3.0</code> diff</a> or the <a href="https://hex.pm/packages/websockex/0.3.0" rel="nofollow">release on <code>hex.pm</code></a> for more information.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="37411" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/websockex-an-elixir-websocket-client/4733/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-37411" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="37411"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="37412" data-post-id="37412">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Azolo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Azolo/120/2189_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Azolo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I started down the path of starting in a different process and ended up realizing that I would need to use a <code>gen_statem</code>. <img src="https://forum.elixirforum.com/images/emoji/apple/persevere.png?v=15" title=":persevere:" class="emoji" alt=":persevere:" loading="lazy" width="20" height="20"></p>
<p>As a result, I feel like the code is kind of a mess right now. But thinking about structuring it for an already defined <code>gen</code> module has helped out. It’s still something I’m trying to do, but wanted to get another release out.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="37412" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/websockex-an-elixir-websocket-client/4733/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-37412" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="37412"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="38397" data-post-id="38397">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="newbie" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  newbie
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi guys, I try to use WebSockex to connect to <a href="http://Socket.io" rel="noopener nofollow ugc">Socket.io</a> server but I was unable to maintain heartbeat, Is it possible to do that?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38397" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/websockex-an-elixir-websocket-client/4733/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-38397" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38397"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="38408" data-post-id="38408">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Azolo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Azolo/120/2189_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Azolo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>There’s no reason it can’t, but it doesn’t do so automatically. What exactly are you having a problem with?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38408" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/websockex-an-elixir-websocket-client/4733/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-38408" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38408"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="38421" data-post-id="38421">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Azolo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Azolo/120/2189_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Azolo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<h2><a name="p-38421-websockex-031-released-1" class="anchor" href="#p-38421-websockex-031-released-1" aria-label="Heading link" rel="nofollow"></a>WebSockex 0.3.1 Released!</h2>
<h3><a name="p-38421-enhancements-2" class="anchor" href="#p-38421-enhancements-2" aria-label="Heading link" rel="nofollow"></a>Enhancements</h3>
<ul>
<li>Handle system messages and parent exits while closing the connection.</li>
<li>The output from <code>:sys.get_status</code> didn’t look pretty in <code>:observer</code>; now it does!</li>
<li><code>format_status/2</code> now an optional callback.</li>
</ul>
<h3><a name="p-38421-bug-fixes-3" class="anchor" href="#p-38421-bug-fixes-3" aria-label="Heading link" rel="nofollow"></a>Bug Fixes</h3>
<ul>
<li>SSL frames sent right after connecting will now be handled instead of being left in a dead Task mailbox.</li>
<li>Fixed some places where <code>dialyzer</code> told me I had my specs screwed up.</li>
</ul>
<p>Take a look at the <a href="https://github.com/Azolo/websockex/compare/v0.3.0...v0.3.1" rel="noopener nofollow ugc"><code>v0.3.0..v0.3.1</code> diff</a> or the <a href="https://hex.pm/packages/websockex/0.3.1" rel="nofollow">release on <code>hex.pm</code></a> for more information.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38421" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/websockex-an-elixir-websocket-client/4733/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-38421" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38421"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #27"></div>
  </section>
</div>
    <div class="postbit" id="38735" data-post-id="38735">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="newbie" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  newbie
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just see <a href="http://Engine.io" rel="noopener nofollow ugc">Engine.io</a> protocol now able to ping, thanks.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38735" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/websockex-an-elixir-websocket-client/4733/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-38735" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38735"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #28"></div>
  </section>
</div>
    <div class="postbit" id="38837" data-post-id="38837">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Azolo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Azolo/120/2189_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Azolo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="newbie" data-post="29" data-topic="4733" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/n/dc4da7/48.png" class="avatar"> newbie:</div>
<blockquote>
<p>Just see <a href="http://Engine.io" rel="noopener nofollow ugc">Engine.io</a> protocol now able to ping, thanks.</p>
</blockquote>
</aside>
<p>Glad you figured it out. If there’s anything else that you have problems with feel free to ask.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="38837" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/websockex-an-elixir-websocket-client/4733/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-38837" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="38837"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #29"></div>
  </section>
</div>
    <div class="postbit" id="40959" data-post-id="40959">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Azolo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Azolo/120/2189_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Azolo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<h2><a name="p-40959-websockex-040-released-1" class="anchor" href="#p-40959-websockex-040-released-1" aria-label="Heading link" rel="nofollow"></a>WebSockex 0.4.0 Released!</h2>
<p>Just as a side note, I think the most exciting thing about this release is the <a href="https://github.com/Azolo/websockex#debugging" rel="noopener nofollow ugc">addition of OTP based debugging capabilities</a>. The debug messages themselves are useful but not perfect. If you would like more hooks or better output feel free to open an issue.</p>
<h3><a name="p-40959-breaking-changes-2" class="anchor" href="#p-40959-breaking-changes-2" aria-label="Heading link" rel="nofollow"></a>Breaking Changes</h3>
<ul>
<li><code>send_frame/2</code> is now synchronous and returns an error when connection is opening or closing.</li>
</ul>
<h3><a name="p-40959-enhancements-3" class="anchor" href="#p-40959-enhancements-3" aria-label="Heading link" rel="nofollow"></a>Enhancements</h3>
<ul>
<li>Added debug printing for the <code>:sys</code> module.</li>
<li>Rework <code>Conn.new</code> to accept other protocols.</li>
<li>Added an <code>InvalidFrameError</code> for frames unrecognized by <code>Frame.encode_frame</code>.</li>
<li>Go through the disconnect cycle when there’s an error while with the <code>{:reply, frame, state}</code> callback response.</li>
<li>Send a close frame with the close code <code>1011</code> when there is an unexpected error. (Like an <code>Exception</code> in the middle of a callback)</li>
<li>Add a more specific error when the <code>:websockex</code> application hasn’t been started yet.</li>
<li>Added a <code>:name</code> options for local registration.</li>
</ul>
<h3><a name="p-40959-bug-fixes-4" class="anchor" href="#p-40959-bug-fixes-4" aria-label="Heading link" rel="nofollow"></a>Bug Fixes</h3>
<ul>
<li>Fix a couple of places where the call stack wasn’t being properly tail-call optimized.-</li>
</ul>
<p>Take a look at the <a href="https://github.com/Azolo/websockex/compare/v0.3.1...v0.4.0" rel="noopener nofollow ugc"><code>v0.3.1...v0.4.0</code> diff</a> or the <a href="https://hex.pm/packages/websockex/0.4.0" rel="nofollow">release on <code>hex.pm</code></a> for more information</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="40959" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/websockex-an-elixir-websocket-client/4733/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-40959" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="40959"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #30"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/4733/load_more?page=4">Load more posts (23 remaining)</a>
</div></template></turbo-stream>