distribustream 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/dsclient +1 -1
- data/distribustream.gemspec +1 -1
- data/lib/pdtp/client/transfer.rb +1 -0
- data/lib/pdtp/client.rb +8 -17
- data/lib/pdtp/common.rb +1 -1
- data/lib/pdtp/server.rb +1 -1
- metadata +1 -1
data/bin/dsclient
CHANGED
data/distribustream.gemspec
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
GEMSPEC = Gem::Specification.new do |s|
|
4
4
|
s.name = "distribustream"
|
5
|
-
s.version = "0.3.
|
5
|
+
s.version = "0.3.1"
|
6
6
|
s.date = "2008-11-09"
|
7
7
|
s.summary = "DistribuStream is a fully open peercasting system allowing on-demand or live streaming media to be delivered at a fraction of the normal cost"
|
8
8
|
s.email = "tony@clickcaster.com"
|
data/lib/pdtp/client/transfer.rb
CHANGED
data/lib/pdtp/client.rb
CHANGED
@@ -65,30 +65,21 @@ module PDTP
|
|
65
65
|
end
|
66
66
|
|
67
67
|
# Connect to the PDTP server. This is a blocking call which runs the client event loop
|
68
|
-
def connect(callbacks = nil
|
69
|
-
|
70
|
-
callbacks
|
71
|
-
else
|
72
|
-
Class.new(Callbacks) {callbacks and include callbacks}
|
73
|
-
end
|
68
|
+
def connect(callbacks = nil)
|
69
|
+
callbacks = Callbacks.new if callbacks.nil?
|
74
70
|
|
75
|
-
|
76
|
-
|
77
|
-
if (arity >= 0 and args.size != expected) or (arity < 0 and args.size < expected)
|
78
|
-
raise ArgumentError, "wrong number of arguments for #{klass}#initialize (#{args.size} for #{expected})"
|
71
|
+
unless callbacks.is_a?(Callbacks)
|
72
|
+
raise ArgumentError, "callbacks must be an instance of PDTP::Client::Callbacks"
|
79
73
|
end
|
80
|
-
|
74
|
+
|
81
75
|
# Run the EventMachine reactor loop
|
82
76
|
EventMachine.run do
|
83
77
|
@http_server.run_evented
|
84
78
|
|
85
|
-
EventMachine.connect(@host, @port, Connection) do |c|
|
86
|
-
# Store reference to the connection
|
87
|
-
@connection = c
|
88
|
-
|
79
|
+
@connection = EventMachine.connect(@host, @port, Connection) do |c|
|
89
80
|
# Set connection variables and configure callbacks
|
90
81
|
c.client = self
|
91
|
-
c.callbacks =
|
82
|
+
c.callbacks = callbacks
|
92
83
|
end
|
93
84
|
|
94
85
|
#@@log.info "connecting with ev=#{EventMachine::VERSION}"
|
@@ -98,7 +89,7 @@ module PDTP
|
|
98
89
|
|
99
90
|
# Are we currently connected to a server?
|
100
91
|
def connected?
|
101
|
-
|
92
|
+
not @connection.nil?
|
102
93
|
end
|
103
94
|
|
104
95
|
# Retrieve the resource at the given path and write it to the given IO object
|
data/lib/pdtp/common.rb
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
# Namespace for all PDTP components
|
24
24
|
module PDTP
|
25
|
-
PDTP::VERSION = '0.3.
|
25
|
+
PDTP::VERSION = '0.3.1' unless defined? PDTP::VERSION
|
26
26
|
def self.version() VERSION end
|
27
27
|
|
28
28
|
PDTP::DEFAULT_PORT = 6086 unless defined? PDTP::DEFAULT_PORT
|
data/lib/pdtp/server.rb
CHANGED
@@ -51,7 +51,7 @@ module PDTP
|
|
51
51
|
# Run a web server to display statistics on the given address and port
|
52
52
|
def enable_status_page(path = '/status')
|
53
53
|
log "status at http://#{@addr}:#{@http_port}#{path}"
|
54
|
-
http_server.register path, StatusHandler.new(@dispatcher)
|
54
|
+
http_server.register path, StatusHandler.new(@dispatcher), true
|
55
55
|
end
|
56
56
|
|
57
57
|
# Serve files from the given directory
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: distribustream
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.
|
6
|
+
version: 0.3.1
|
7
7
|
date: 2008-11-09 00:00:00 -07:00
|
8
8
|
summary: DistribuStream is a fully open peercasting system allowing on-demand or live streaming media to be delivered at a fraction of the normal cost
|
9
9
|
require_paths:
|