libuv

I notice this very interesting program uses select and fd_set, the old "flip through all file descriptors every time data comes in" strategy. Since cjdns itself uses libuv I thought it a bit silly that this program can't take advantage of libuv. So I went and redid all the network code in libuv instead of using a select loop. :p

There are still some libuv things I didn't do. It doesn't use the asynchronous getaddrinfo, f/i. But it takes away the dependency on a "select" loop. 

This code compiles on my machine, and seems to run fine. I was able to use meshchat as an IRC server, and meshchat got the routing table from the cjdns admin interface. I haven't had a chance to test the actual message exchange...

I also did a thing, b/c most IRC servers don't take any commands besides NICK, USER and PASS at first, and only then go to checking for all possible IRC commands. You can take that or leave it.