135 struct mq *
mq_connect(
const char *addr,
int port);
147 struct mq *
mq_serve(
const char *addr,
int port);
178 int mq_wait(
struct mq *mq, time_t stoptime);
266 int mq_poll_rm(
struct mq_poll *p,
struct mq *mq);
358 int mq_send_fd(
struct mq *mq,
int fd,
size_t maxlen);
393 int mq_store_fd(
struct mq *mq,
int fd,
size_t maxlen);
409 mq_msg_t
mq_recv(
struct mq *mq,
size_t *length);
struct mq * mq_poll_error(struct mq_poll *p)
Find a queue in the error state or closed socket.
int mq_poll_rm(struct mq_poll *p, struct mq *mq)
Remove a message queue from a polling group.
int mq_geterror(struct mq *mq)
Check for errors on the connection.
void mq_set_tag(struct mq *mq, void *tag)
Set the tag associated with the given queue.
struct mq_poll * mq_poll_create(void)
Create a new (empty) polling group.
int mq_store_fd(struct mq *mq, int fd, size_t maxlen)
Write the next message to the given file descriptor.
struct mq * mq_connect(const char *addr, int port)
Connect to a remote host.
int mq_address_local(struct mq *mq, char *addr, int *port)
Return the local address of the queue in text format.
int mq_send_buffer(struct mq *mq, buffer_t *buf, size_t maxlen)
Push a message onto the send queue.
void mq_poll_delete(struct mq_poll *p)
Delete a polling group.
void * mq_get_tag(struct mq *mq)
Get the tag associated with the given queue.
struct mq * mq_serve(const char *addr, int port)
Prepare to accept connections.
struct mq * mq_poll_readable(struct mq_poll *p)
Find a queue with messages waiting.
int mq_address_remote(struct mq *mq, char *addr, int *port)
Return the remote address of the queue in text format.
int mq_poll_add(struct mq_poll *p, struct mq *mq)
Add a message queue to a polling group.
String Buffer Operations.
int mq_wait(struct mq *mq, time_t stoptime)
Wait for a message or connection.
mq_msg_t mq_recv(struct mq *mq, size_t *length)
Pop a message from the receive queue.
void mq_close(struct mq *mq)
Close a connection.
int mq_store_buffer(struct mq *mq, buffer_t *buf, size_t maxlen)
Store the next message in the given buffer.
struct mq * mq_accept(struct mq *server)
Accept a connection.
struct mq * mq_poll_acceptable(struct mq_poll *p)
Find a server queue with connections waiting.
int mq_poll_wait(struct mq_poll *p, time_t stoptime)
Wait for messages or connections.
int mq_send_fd(struct mq *mq, int fd, size_t maxlen)
Stream a file descriptor across the wire.