lib/ionian/socket.rb in ionian-0.6.0 vs lib/ionian/socket.rb in ionian-0.6.1

- old
+ new

@@ -2,10 +2,11 @@ module Ionian # A convenient wrapper for TCP, UDP, and Unix client sockets. class Socket + # Returns the regular expression used to match incoming data. attr_accessor :expression # Creates a new socket or wraps an existing socket. # # Args: @@ -71,9 +72,10 @@ default_protocol = :udp if Ionian::Extension::Socket.multicast? @host default_protocol = :unix if @host.start_with? '/' @protocol = kwargs.fetch :protocol, default_protocol @persistent = kwargs.fetch :persistent, true + @persistent = true if @protocol == :udp @reuse_addr = kwargs.fetch :reuse_addr, false @no_delay = kwargs.fetch :no_delay, false @cork = kwargs.fetch :cork, false \ No newline at end of file