Implement demo of DER comms
This commit is contained in:
@@ -14,7 +14,9 @@ namespace StudySystemClient {
|
||||
|
||||
this.connection = connection;
|
||||
connection.received.connect((msg) => {
|
||||
response_label.label = "Response: " + (string)msg;
|
||||
var der = Der.decode(msg) as Der.Choice;
|
||||
var str = der.value as Der.Utf8String;
|
||||
response_label.label = "Response: " + str.value;
|
||||
});
|
||||
|
||||
var box = new Gtk.Box(Gtk.Orientation.VERTICAL, 10);
|
||||
@@ -24,7 +26,10 @@ namespace StudySystemClient {
|
||||
box.margin_bottom = 10;
|
||||
|
||||
send_button = new Gtk.Button.with_label("Send");
|
||||
send_button.clicked.connect(() => connection.send("Foo".data));
|
||||
send_button.clicked.connect(() => {
|
||||
var msg = new Der.Choice(0, new Der.Null());
|
||||
connection.send(msg.encode());
|
||||
});
|
||||
box.append(send_button);
|
||||
|
||||
response_label = new Gtk.Label("");
|
||||
|
||||
Reference in New Issue
Block a user