about summary refs log tree commit homepage
diff options
authorEric Wong <normalperson@yhbt.net>2013-08-25 07:57:33 +0000
committerEric Wong <normalperson@yhbt.net>2013-08-25 08:03:49 +0000
commit51212f0405057c03b032814677055b8ed2c4a494 (patch)
parent09f75c61a5b4ab1b6706908786815a813ed12d8f (diff)
It's too much work for me to attempt to wedge SOCK_DGRAM or
SOCK_STREAM support into this.  SOCK_SEQPACKET is the best use of
_my_ time and I have limited patience for crippled OSes.  Linux has
had this forever and FreeBSD 9 supports SOCK_SEQPACKET already, so
maybe this will be another way to nudge developers of other OSes
into supporting SOCK_SEQPACKET.

If somebody can provide clean patches to support SOCK_DGRAM or
SOCK_STREAM, I'll accept them.
2 files changed, 2 insertions, 10 deletions
diff --git a/Documentation/dtas-player_protocol.txt b/Documentation/dtas-player_protocol.txt
index 7c5d57f..360eb84 100644
--- a/Documentation/dtas-player_protocol.txt
+++ b/Documentation/dtas-player_protocol.txt
@@ -8,7 +8,7 @@ dtas-player_protocol - protocol for controling dtas-player
 This gives a specification of the dtas-player protocol over a local Unix
-SOCK_SEQPACKET or SOCK_DGRAM socket.  The dtas-player protocol should NOT be
+SOCK_SEQPACKET socket.  The dtas-player protocol should NOT be
 considered stable at this point and compatibility will break.
 Inspiration is taken from MPRIS and MPRIS 2.0 specifications (e.g.
diff --git a/lib/dtas/unix_client.rb b/lib/dtas/unix_client.rb
index cc6bf0f..0811ad4 100644
--- a/lib/dtas/unix_client.rb
+++ b/lib/dtas/unix_client.rb
@@ -14,15 +14,7 @@ class DTAS::UNIXClient # :nodoc:
   def initialize(path = self.class.default_path)
-    @to_io = begin
-      raise if ENV["_DTAS_NOSEQPACKET"]
-      Socket.new(:AF_UNIX, :SOCK_SEQPACKET, 0)
-    rescue
-      warn("get your operating system developers to support " \
-           "SOCK_SEQPACKET for AF_UNIX sockets")
-      warn("falling back to SOCK_DGRAM, reliability possibly compromised")
-      Socket.new(:AF_UNIX, :SOCK_DGRAM, 0)
-    end
+    @to_io = Socket.new(:AF_UNIX, :SOCK_SEQPACKET, 0)