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KUXEJSSR6264PACKRP7OT2SWNUV6AC
TKEQSYZ7PZ4GBD6R4EOOE26TQ6VKXBXLYRLUUYWOOQ7SVXQSVETQC
W4S5ZVBQG3G3MCXNCKZFHAQX7XH3UW6WTKVXN2XGRFG5EJ7JPLNQC
pub fn setup(c chan Command) {
l := net.listen_tcp(8099) or {
pub fn init(c chan Command, config setup.Config) Actor {
mut self := Actor{
out: c
rpc_port: config.rpc_port
}
return self
}
pub fn (mut self Actor) setup() {
l := net.listen_tcp(self.rpc_port) or {
jstr := r'{"$a":2}'
println('($jstr.len) $jstr')
wtf := json2.raw_decode(jstr) ?
println('cli $wtf')
config := setup.config()
host := '127.0.0.1:$config.rpc_port'
println(host)
if conn := connect(host) {
a := conn.peer_addr() or { panic(err) }
println(a)
irc_add(conn)
println(conn.read_line())
println('after')
} else {
println('cant connect to $host $err')
}
}
fn connect(host string) ?net.TcpConn {
return net.dial_tcp(host)
}
fn irc_add(conn net.TcpConn) {
mut params := map[string]string{}
params['host'] = "irc.freenode.net:6667"
cmd := rpc.Command{
verb: 'connect'
params: params
}
conn.write(json.encode(cmd).bytes())