From 6052b1f119d2b1494a7f2691f4dfed235b560636 Mon Sep 17 00:00:00 2001 From: slvr Date: Sat, 10 Aug 2013 00:30:18 +0100 Subject: network_registerhandler --- other/DHT_bootstrap.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'other/DHT_bootstrap.c') diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c index befe2225..4b0adeff 100644 --- a/other/DHT_bootstrap.c +++ b/other/DHT_bootstrap.c @@ -113,9 +113,8 @@ int main(int argc, char *argv[]) free(bootstrap_key); } - IP_Port ip_port; - uint8_t data[MAX_UDP_PACKET_SIZE]; - uint32_t length; + DHT_init(); + friendreq_init(); int is_waiting_for_dht_connection = 1; while(1) @@ -127,11 +126,8 @@ int main(int argc, char *argv[]) } doDHT(); - while(receivepacket(&ip_port, data, &length) != -1) - { - DHT_handlepacket(data, length, ip_port); - friendreq_handlepacket(data, length, ip_port); - } + networking_poll(); + c_sleep(1); } shutdown_networking(); -- cgit v1.2.3