Skip to content

Commit

Permalink
Merge pull request #3 from daumiller/soreuse
Browse files Browse the repository at this point in the history
SO_REUSE* cross-platform
  • Loading branch information
Dillon Aumiller committed Oct 9, 2015
2 parents aa1601e + f3979dd commit c5b47c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/ssdp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def create_listener(options)
membership = IPAddr.new(options[:broadcast]).hton + IPAddr.new(options[:bind]).hton
listener.setsockopt Socket::IPPROTO_IP, Socket::IP_ADD_MEMBERSHIP, membership
listener.setsockopt Socket::SOL_SOCKET, Socket::SO_REUSEADDR, true
if defined? Socket::SO_REUSEPORT
listener.setsockopt Socket::SOL_SOCKET, Socket::SO_REUSEPORT, true
end
listener.bind options[:bind], options[:port]
listener
end
Expand Down
2 changes: 1 addition & 1 deletion ssdp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Gem::Specification.new do |spec|
spec.name = 'ssdp'
spec.platform = Gem::Platform::RUBY
spec.require_paths = ['lib']
spec.version = '1.1.3'
spec.version = '1.1.4'
spec.license = 'BSD 2-Clause'
spec.summary = 'SSDP client/server library.'
spec.description = 'SSDP client/server library. Server notify/part/respond; client search/listen.'
Expand Down

0 comments on commit c5b47c2

Please sign in to comment.