Stream


Object Hierarchy:

Object hierarchy for Stream

Description:

public class Stream : Object

Per-connection bin codec — write and parse Serializable objects.

Owns the I/O streams and even/odd wire-name tables for one channel. OLLMrpc.Client and OLLMrpc.Transport.Connection keep one Stream for the connection lifetime. Call write to send a root object; parse to receive one.

Example

OLLMrpc.Bin.register("Pair", typeof(Pair));

var mem = new GLib.MemoryOutputStream.resizable();
var out_stream = new GLib.DataOutputStream(mem);
var write_bin = new OLLMrpc.Bin.Stream(null, out_stream);
write_bin.write(new Pair() { name = "alpha", count = 42 });
out_stream.close();

var read_bin = new OLLMrpc.Bin.Stream(
new GLib.DataInputStream(
new GLib.MemoryInputStream.from_bytes(mem.steal_as_bytes())),
null);
var parsed = read_bin.parse() as Pair;

Pass null for the unused direction in memory-only tests.

See also:

Serializable, register


Namespace: OLLMrpc.Bin
Package: ollmchat

Content:

Constants:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object