Permalink
Browse files

been a busy few weeks, lots to do here

  • Loading branch information...
1 parent a0a07cf commit 8f15ee75314f7921ab1d0a7785824fe6c5c4800c @quartzjer committed Dec 5, 2010
Showing with 46 additions and 30 deletions.
  1. +32 −0 README.md
  2. +0 −28 README.txt
  3. +14 −2 perl/switch.pl
View
@@ -0,0 +1,32 @@
+TeleHash - Distributed JSON - http://telehash.org/
+==================================================
+
+* org/ telehash.org contents (all docs so far)
+* perl/ test implementations and utils in Perl
+* c/ basic test stuff in C
+* ruby/ rudimentary testing in Ruby
+* switchd/ plans to create a utility daemon to do the dirty work
+* diag/ graffle/diagrams of protocol states
+
+
+What tech does one need to implement a switch?
+==============================================
+
+* UDP
+* JSON
+* SHA1
+* XOR'ing the 160 bits of a SHA1 hash
+* handling both network events and timers (and possibly interactions with the "app" it's serving)
+
+What does a switch need to do?
+==============================
+ - listen for UDP packets (off a random port)
+ - send something to an initial seed to discover it's public IP:PORT
+ - announce itself and try to discover other switches nearby to it
+ - maintain the "lines" it has active with any other switches
+ - validate sender/status
+ - track bytes sent/received
+ - answer requests for nearby switches
+ - accept "taps" from other switches
+ - match incoming signals against any active taps and forward them
+ - that's plenty :)
View
@@ -1,28 +0,0 @@
-TeleHash - Distributed JSON - http://telehash.org/
-
-org/ telehash.org contents (all docs so far)
-perl/ test implementations and utils in Perl
-c/ basic test stuff in C
-ruby/ rudimentary testing in Ruby
-switchd/ plans to create a utility daemon to do the dirty work
-diag/ graffle/diagrams of protocol states
-
-
-What tech does one need to implement a switch?
- UDP
- JSON
- SHA1
- XOR'ing the 160 bits of a SHA1 hash
- handling both network events and timers (and possibly interactions with the "app" it's serving)
-
-What does a switch need to do?
- - listen for UDP packets (off a random port)
- - send something to an initial seed to discover it's public IP:PORT
- - announce itself and try to discover other switches nearby to it
- - maintain the "lines" it has active with any other switches
- - validate sender/status
- - track bytes sent/received
- - answer requests for nearby switches
- - accept "taps" from other switches
- - match incoming signals against any active taps and forward them
- - that's plenty :)
View
@@ -55,6 +55,14 @@
in_stdin() if($s == \*STDIN);
in_udp() if($s == \*SOCKET);
}
+ # check any dials in progress to see if they're done
+ for my $end (keys %dialing)
+ {
+ if(time - $dialing{$end}->{lastat} > 3)
+ {
+ # send back to stdout the dial done event w/ top few
+ }
+ }
# maintenance
if(scalar @ready == 0 || $lastloop+1 < int(time))
{
@@ -76,13 +84,17 @@ sub in_stdin
# track an active tap to another switch
if($j->{"-tap"})
{
-
+ # tap specific switch or auto-dial?
+ $tap_end = $j->{"-tap"};
+ $tap_js = $j->{".tap"};
+ # dial $tap_end now
}
# keep a line open and send back status changes
if($j->{"-line"})
{
-
+ # IPP must be connected?
+ # return immediate status
}
# convenience, do the dialing work

0 comments on commit 8f15ee7

Please sign in to comment.