-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblackboard.q
More file actions
35 lines (26 loc) · 762 Bytes
/
Copy pathblackboard.q
File metadata and controls
35 lines (26 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/Blackboard.q
/------------
/A very simple instant messaging client to be run on two connected
/servers. Set the first instance to port p1, and the second to p2, then
/connect(p1) on the the server on p2. You can then run send(msg) from
/either instance and it will be displayed on a table (blackboard).
/
/This is written as part of the integration test for my q/kdb+ GUI, this
/program will be represented graphcially when the GUI software is
/sufficiently completed.
blk.p:0;
blk.h:();
blk.t:([]frm:();sent:();rec:();msg:());
set_up:{[]
};
connect:{[port]
blk.p::port;
blk.h::hopen `::blk.p;
set_up[]; };
send:{[msg]
in: blk.h (sent:.z.z;"recieve[",msg,"]");
insert[`blk.h;(blk.p;sent;in;msg)] };
recieve:{[msg]
};
show_table:{[]
};