24 #ifndef WALTHAM_CONNECTION_H 25 #define WALTHAM_CONNECTION_H 30 #include <sys/types.h> 31 #include <sys/socket.h> 128 wth_accept(
int sockfd,
struct sockaddr *addr, socklen_t *addrlen);
318 const char *interface,
319 uint32_t error_code);
354 const char **interface,
355 uint32_t *object_id);
368 struct wthp_registry *
382 struct wthp_callback *
void wth_connection_post_error_no_memory(struct wth_connection *conn)
Post an out of memory display error.
Client-side object.
Definition: waltham-connection.h:135
struct wthp_registry * wth_connection_create_registry(struct wth_connection *conn)
Creates a new registry using the internal wth_display.
int wth_connection_dispatch(struct wth_connection *conn)
Dispatch incoming messages.
void wth_connection_set_registry_callback(struct wth_connection *conn, wth_registry_callback_func registry_callback, void *user_data)
Set the callback to be called once a client creates a registry.
struct wth_connection * wth_connection_from_fd(int fd, enum wth_connection_side side)
Use an already connected socket.
Server-side object.
Definition: waltham-connection.h:136
int wth_connection_roundtrip(struct wth_connection *conn)
Make a roundtrip from a client.
struct wth_connection * wth_connect_to_server(const char *host, const char *port)
Connect to a remote Waltham server.
uint32_t wth_connection_get_protocol_error(struct wth_connection *conn, const char **interface, uint32_t *object_id)
Return protocol error details.
struct wthp_callback * wth_connection_sync(struct wth_connection *conn)
Return a callback using the internal wth_display.
Waltham generic protocol object interface.
int wth_connection_read(struct wth_connection *conn)
Read data received from the network.
void wth_connection_destroy(struct wth_connection *conn)
Disconnect.
int wth_connection_flush(struct wth_connection *conn)
Flush buffered messages to the network.
int wth_connection_get_fd(struct wth_connection *conn)
Get connection file descriptor.
wth_connection_side
Define which side we are on.
Definition: waltham-connection.h:134
void(* wth_registry_callback_func)(struct wthp_registry *registry, void *user_data)
Prototype of the callback to be called whenever a client creates a registry.
Definition: waltham-connection.h:403
struct wth_connection * wth_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
Accept a Waltham client connection.
int wth_connection_get_error(struct wth_connection *conn)
Return the connection error state.