From 51212f0405057c03b032814677055b8ed2c4a494 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 25 Aug 2013 07:57:33 +0000 Subject: unix_client: remove non-SOCK_SEQPACKET support 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. --- Documentation/dtas-player_protocol.txt | 2 +- lib/dtas/unix_client.rb | 10 +--------- 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 # DESCRIPTION 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: end 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) @to_io.connect(Socket.pack_sockaddr_un(path)) end -- cgit v1.2.3-24-ge0c7