summaryrefslogtreecommitdiff
path: root/ot_livesync.h
diff options
context:
space:
mode:
authorerdgeist <>2008-10-06 02:05:53 +0000
committererdgeist <>2008-10-06 02:05:53 +0000
commit465cc2ecdf14909144debe70a4833642e11697da (patch)
tree0c386a01cccd0f8974d5fb74a895eb96b398c414 /ot_livesync.h
parent17724dde29c488f08338653ac6a98fb7a9fd6d22 (diff)
Live sync is now handled in its own thread. Therefore it now creates and handles its own sockets.
Diffstat (limited to 'ot_livesync.h')
-rw-r--r--ot_livesync.h18
1 files changed, 3 insertions, 15 deletions
diff --git a/ot_livesync.h b/ot_livesync.h
index 4dc6b60..27070d6 100644
--- a/ot_livesync.h
+++ b/ot_livesync.h
@@ -10,14 +10,14 @@
10#include "trackerlogic.h" 10#include "trackerlogic.h"
11 11
12/* 12/*
13 Syncing is done as udp packets in the multicast domain 224.23.42.N port 9696 13 Syncing is done as udp packets in the multicast domain 224.0.42.N port 9696
14 14
15 Each tracker should join the multicast group and send its live sync packets 15 Each tracker should join the multicast group and send its live sync packets
16 to that group, using a ttl of 1 16 to that group, using a ttl of 1
17 17
18 Format of a live sync packet is straight forward and depends on N: 18 Format of a live sync packet is straight forward and depends on N:
19 19
20 For N == 1: (simple tracker2tracker sync) 20 For N == 23: (simple tracker2tracker sync)
21 0x0000 0x04 id of tracker instance 21 0x0000 0x04 id of tracker instance
22 [ 0x0004 0x14 info_hash 22 [ 0x0004 0x14 info_hash
23 0x0018 0x04 peer's ipv4 address 23 0x0018 0x04 peer's ipv4 address
@@ -25,7 +25,7 @@
25 0x0020 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 ) 25 0x0020 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 )
26 ]* 26 ]*
27 27
28 For N == 2: (aggregator syncs) 28 For N == 24: (aggregator syncs)
29 0x0000 0x04 id of tracker instance 29 0x0000 0x04 id of tracker instance
30 [ 0x0004 0x14 info_hash 30 [ 0x0004 0x14 info_hash
31 0x0018 0x01 number of peers 31 0x0018 0x01 number of peers
@@ -41,18 +41,6 @@
41#ifdef WANT_SYNC_LIVE 41#ifdef WANT_SYNC_LIVE
42 42
43#define LIVESYNC_PORT 9696 43#define LIVESYNC_PORT 9696
44#define LIVESYNC_MCASTDOMAIN_1 224,23,42,1
45#define LIVESYNC_MCASTDOMAIN_2 224,23,42,2
46extern char groupip_1[4];
47extern char groupip_2[4];
48
49extern int64 g_livesync_socket;
50
51#define LIVESYNC_BUFFINSIZE (256*256)
52#define LIVESYNC_BUFFSIZE 1504
53#define LIVESYNC_BUFFWATER (sizeof(ot_peer)+sizeof(ot_hash))
54
55#define LIVESYNC_MAXDELAY 15
56 44
57void livesync_init(); 45void livesync_init();
58void livesync_deinit(); 46void livesync_deinit();