BEWT3YUFWOAKQVEO4ZERUTFISI26ULUCNKICDZFYZ4OM3DRLCKWQC
LNGUDOUQK35O5IIUHSVJ5LW54JA7QNMNCJGQNYWPRDUSK6R4XCLQC
ZMAZUHFHJOW2GSUH5SUDXRG4STQ6PQHWYGZIZHEJCN73PSNQOAAQC
V7HS237PBWI3JIA2FKGHVZ6CXT2BFE6VMXGZSJD7RGD6A3U2ISGQC
S4P2B3FPF57HPHTIAYGMPCVKB7573IB5ZBKNXVBTB6ICCPF55WNQC
TKEQSYZ7PZ4GBD6R4EOOE26TQ6VKXBXLYRLUUYWOOQ7SVXQSVETQC
4SFN5L36NYBFPXLBSWXO4KXDBY2W4YP4CNNVX23E2BQ7W2A6GVZQC
JOKWFDRJ3ZLUHVBXMWKZTL5N2SOSPUGDKJFT2M36W56Q7SZ5I2VQC
TLOUTLMOHXYNPVXEBPDNT5XVSLIITQOVP7Y7LSLTK5YUOSHT7JOAC
FHQJ2LWCSUZWDSAQ7IOSQC4LM3HIWNMYWCI4PA7CRHMOLTM43WPAC
self.networks.push(Network{hostnames: names
state: ConnState.disconnected})
println(self.networks)
self.networks.push(Network{
hostnames: names
state: ConnState.disconnected
})
println(self.networks)
}
pub fn (self &IrcActor) connect() {
disconns := self.networks.filter(it.state == ConnState.disconnected)
println('irc.connect disconns $disconns.len')
for mut ircnet in disconns {
println('comm go $ircnet')
addr := ircnet.hostnames[0]
if sock := net.dial_tcp(addr) {
println('irc connected $addr')
ircnet.sock = sock
go self.comm(ircnet)
} else {
println('irc connect fail')
}
}
pub fn (self &IrcActor) comm() {
addr := "irc.freenode.net:6667" //placeholder
if sock := net.dial_tcp(addr) {
println('irc connected $addr')
mut reader := io.new_buffered_reader(reader: io.make_reader(sock))
for {
if line := reader.read_line() {
self.out <- line
} else {
break
}
pub fn (self &IrcActor) comm(ircnet &Network) {
mut reader := io.new_buffered_reader(reader: io.make_reader(ircnet.sock))
for {
if line := reader.read_line() {
self.out <- line
} else {