aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/core/stanza_writer.vala
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/core/stanza_writer.vala')
-rw-r--r--xmpp-vala/src/core/stanza_writer.vala16
1 files changed, 8 insertions, 8 deletions
diff --git a/xmpp-vala/src/core/stanza_writer.vala b/xmpp-vala/src/core/stanza_writer.vala
index 5b926a93..aecf8983 100644
--- a/xmpp-vala/src/core/stanza_writer.vala
+++ b/xmpp-vala/src/core/stanza_writer.vala
@@ -12,11 +12,11 @@ public class StanzaWriter {
this.output = output;
}
- public async void write_node(StanzaNode node) throws IOError {
- yield write_data(node.to_xml().data);
+ public async void write_node(StanzaNode node, int io_priority = Priority.DEFAULT, Cancellable? cancellable = null) throws IOError {
+ yield write_data(node.to_xml().data, io_priority, cancellable);
}
- public async void write_nodes(StanzaNode node1, StanzaNode node2) throws IOError {
+ public async void write_nodes(StanzaNode node1, StanzaNode node2, int io_priority = Priority.DEFAULT, Cancellable? cancellable = null) throws IOError {
var data1 = node1.to_xml().data;
var data2 = node2.to_xml().data;
@@ -29,21 +29,21 @@ public class StanzaWriter {
concat[i++] = datum;
}
- yield write_data(concat);
+ yield write_data(concat, io_priority, cancellable);
}
- public async void write(string s) throws IOError {
- yield write_data(s.data);
+ public async void write(string s, int io_priority = Priority.DEFAULT, Cancellable? cancellable = null) throws IOError {
+ yield write_data(s.data, io_priority, cancellable);
}
- private async void write_data(owned uint8[] data) throws IOError {
+ private async void write_data(owned uint8[] data, int io_priority = Priority.DEFAULT, Cancellable? cancellable = null) throws IOError {
if (running) {
queue.push_tail(new SourceFuncWrapper(write_data.callback));
yield;
}
running = true;
try {
- yield output.write_all_async(data, 0, null, null);
+ yield output.write_all_async(data, io_priority, cancellable, null);
} catch (IOError e) {
cancel();
throw e;