Class Client
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDestroyListener
(org.freedesktop.wayland.server.Listener listener) static Client
Create a client for the given file descriptorvoid
destroy()
boolean
void
flush()
Flush pending events to the client,static Client
get
(MemorySegment pointer) Return Unix credentials for the clientGet the display object for the given clientResource
<?> getObject
(int id) Look up an object in the client name space.int
hashCode()
-
Field Details
-
pointer
-
-
Method Details
-
create
Create a client for the given file descriptorGiven a file descriptor corresponding to one end of a socket, this function will create a
Client
and add the new client to the compositors client list. At that point, the client is initialized and ready to run, as if the client had connected to the servers listening socket. When the client eventually sends requests to the compositor, theClient
argument to the request handler will be the client returned from this function.The other end of the socket can be passed to {link WlDisplayProxy#connectToFd(int)} on the client side or used with the WAYLAND_SOCKET environment variable on the client side.
On failure this function sets errno accordingly and returns NULL.
- Parameters:
display
- The display objectfd
- The file descriptor for the socket to the client- Returns:
- The new client object or NULL on failure.
-
get
-
flush
public void flush()Flush pending events to the client,Events sent to clients are queued in a buffer and written to the socket later - typically when the compositor has handled all requests and goes back to block in the event loop. This function flushes all queued up events for a client immediately.
-
addDestroyListener
protected void addDestroyListener(org.freedesktop.wayland.server.Listener listener) -
getDisplay
Get the display object for the given client- Returns:
- The display object the client is associated with.
-
getObject
Look up an object in the client name space. This looks up an object in the client object name space by its object ID.- Parameters:
id
- The object id- Returns:
- The object or null if there is not object for the given ID
-
getCredentials
Return Unix credentials for the clientThis function returns the process ID, the user ID and the group ID for the given client. The credentials come from getsockopt() with SO_PEERCRED, on the client socket fd.
Be aware that for clients that a compositor forks and execs and then connects using socketpair(), this function will return the credentials for the compositor. The credentials for the socketpair are set at creation time in the compositor.
-
destroy
public void destroy() -
hashCode
-
equals
-