summary refs log tree commit diff
path: root/bounce.c
diff options
context:
space:
mode:
Diffstat (limited to 'bounce.c')
-rw-r--r--bounce.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/bounce.c b/bounce.c
index b3d8b33..43d3ef8 100644
--- a/bounce.c
+++ b/bounce.c
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/socket.h>
 #include <sysexits.h>
 #include <tls.h>
 #include <unistd.h>
@@ -91,6 +92,15 @@ int main(int argc, char *argv[]) {
 	int bind[BindCap];
 	size_t bindLen = listenBind(bind, BindCap, localHost, localPort);
 
+	int server = serverConnect(host, port);
+	serverLogin(pass, auth, nick, user, real);
+
+	// TODO: Wait for successful login before listening.
+	for (size_t i = 0; i < bindLen; ++i) {
+		int error = listen(bind[i], 1);
+		if (error) err(EX_IOERR, "listen");
+	}
+
 	// Wishing for struct-of-arrays...
 	struct pollfd fds[BindCap];
 	for (size_t i = 0; i < bindLen; ++i) {