Class: Gio::UnixSocketAddress
- Inherits:
-
Object
- Object
- Gio::UnixSocketAddress
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#abstract=(abstract) ⇒ TrueClass
Whether or not this is an abstract address.
-
#abstract? ⇒ TrueClass
Whether or not this is an abstract address.
-
#address_type ⇒ Gio::UnixSocketAddressType
Address-type.
- #address_type=(address_type) ⇒ Gio::UnixSocketAddressType
-
#is_abstract ⇒ TrueClass
Tests if address is abstract.
-
#new(path) ⇒ Gio::SocketAddress
Creates a new GUnix::SocketAddress for path.
-
#new_abstract(path, path_len) ⇒ Gio::SocketAddress
Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED GUnix::SocketAddress for path.
-
#new_with_type(path, path_len, type) ⇒ Gio::SocketAddress
Creates a new GUnix::SocketAddress of type type with name path.
-
#path ⇒ String
Path.
- #path=(path) ⇒ String
-
#path_as_array ⇒ Gio::
Path-as-array.
- #path_as_array=(path_as_array) ⇒ Gio::
-
#path_len ⇒ Integer
Gets the length of address’s path.
Instance Method Details
#abstract=(abstract) ⇒ TrueClass
Whether or not this is an abstract address
#abstract? ⇒ TrueClass
Whether or not this is an abstract address
#address_type ⇒ Gio::UnixSocketAddressType
Returns address-type.
#address_type=(address_type) ⇒ Gio::UnixSocketAddressType
#is_abstract ⇒ TrueClass
Tests if address is abstract.
#new(path) ⇒ Gio::SocketAddress
Creates a new GUnix::SocketAddress for path.
To create abstract socket addresses, on systems that support that, use g_unix_socket_address_new_abstract().
#new_abstract(path, path_len) ⇒ Gio::SocketAddress
Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED GUnix::SocketAddress for path.
#new_with_type(path, path_len, type) ⇒ Gio::SocketAddress
Creates a new GUnix::SocketAddress of type type with name path.
If type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to calling g_unix_socket_address_new().
If type is %G_UNIX_SOCKET_ADDRESS_ANONYMOUS, path and path_len will be ignored.
If path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then path_len bytes of path will be copied to the socket’s path, and only those bytes will be considered part of the name. (If path_len is -1, then path is assumed to be NUL-terminated.) For example, if path was “test”, then calling g_socket_address_get_native_size() on the returned socket would return 7 (2 bytes of overhead, 1 byte for the abstract-socket indicator byte, and 4 bytes for the name “test”).
If path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then path_len bytes of path will be copied to the socket’s path, the rest of the path will be padded with 0 bytes, and the entire zero-padded buffer will be considered the name. (As above, if path_len is -1, then path is assumed to be NUL-terminated.) In this case, g_socket_address_get_native_size() will always return the full size of a ‘struct sockaddr_un`, although g_unix_socket_address_get_path_len() will still return just the length of path.
%G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course, when connecting to a server created by another process, you must use the appropriate type corresponding to how that process created its listening socket.
#path ⇒ String
Returns path.
#path=(path) ⇒ String
#path_as_array ⇒ Gio::
Returns path-as-array.
#path_as_array=(path_as_array) ⇒ Gio::
#path_len ⇒ Integer
Gets the length of address’s path.
For details, see g_unix_socket_address_get_path().