Skip to content

Commit

Permalink
Fix socket options for newest elixir-socket package
Browse files Browse the repository at this point in the history
* Updated elixir-socket in mix.exs
  • Loading branch information
edennis committed Mar 13, 2017
1 parent 73a1af7 commit 4d85222
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/nsq/connection/initializer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule NSQ.Connection.Initializer do
import NSQ.Protocol
require Logger

@socket_opts [as: :binary, active: false, deliver: :term, packet: :raw]
@socket_opts [as: :binary, mode: :passive, packet: :raw]

@project ElixirNsq.Mixfile.project
@user_agent "#{@project[:app]}/#{@project[:version]}"
Expand All @@ -17,7 +17,7 @@ defmodule NSQ.Connection.Initializer do
def connect(%{nsqd: {host, port}} = state) do
if should_connect?(state) do
socket_opts = @socket_opts |> Keyword.merge(
send_timeout: state.config.write_timeout,
send: [{:timeout, state.config.write_timeout}],
timeout: state.config.dial_timeout,
)

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule ElixirNsq.Mixfile do
{:ibrowse, "~> 4.2"},
{:httpotion, "~> 2.1.0"},
{:uuid, "~> 1.1.2"},
{:socket, ">= 0.3.1 and <= 0.3.5"},
{:socket, "~> 0.3.1"},

# testing
{:secure_random, "~> 0.2", only: :test},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"poison": {:hex, :poison, "1.5.0", "f2f4f460623a6f154683abae34352525e1d918380267cdbd949a07ba57503248", [:mix], []},
"ranch": {:hex, :ranch, "1.2.0", "b286a948a0706a700a9f577e5cecbb2dc66097ea79f3ddb20ba5536069bdb7aa", [:make], []},
"secure_random": {:hex, :secure_random, "0.2.0", "d5458ab5613410439c21a2fdbc52e98e6c96338f3ea25d08220c30cfc55f1238", [:mix], []},
"socket": {:hex, :socket, "0.3.1", "c17c6da3f85ae07b730fcfa3b9b44051e1f7cbd5c202c46ea926493004d4cc18", [:mix], []},
"socket": {:hex, :socket, "0.3.7", "68c029a8449fc6efc5f4c3bdf6d8b19ca94d3304e419f364c5cfc8b716f7c219", [:mix], []},
"uuid": {:hex, :uuid, "1.1.2", "add3d0a6324ac2e3974855822ddf1cd4e270d8c136a75bcb71332bd4956b0563", [:mix], []}}

0 comments on commit 4d85222

Please sign in to comment.