Sha256: da6c4f5efc7ae90ae0144fdc62a92357dc0901ad5f2bfbaa37560f036d14aa50
Contents?: true
Size: 649 Bytes
Versions: 6
Compression:
Stored size: 649 Bytes
Contents
module RubySL module Socket module Foreign class SockaddrUn < Rubinius::FFI::Struct config('rbx.platform.sockaddr_un', :sun_family, :sun_path) def self.with_sockaddr(addr) if addr.bytesize > size raise ArgumentError, "UNIX socket path is too long (max: #{size} bytes)" end pointer = Foreign.memory_pointer(size) pointer.write_string(addr, addr.bytesize) new(pointer) end def family self[:sun_family] end def to_s pointer.read_string(pointer.total) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems