GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Packet is a Library for Event Driven Network Programming in Ruby
Homepage: http://packet.googlecode.com
Clone URL: git://github.com/gnufied/packet.git
mac osx fiex
gnufied (author)
Fri Oct 03 14:39:57 -0700 2008
commit  0a23d8143cdb2e7d96ef5c28eb32a821d1ae5505
tree    2333142f5502638bdfe555d0ebadf4a7e5f641d8
parent  f2a593d59c42a3daf2c91060d37320d3124c66b2
...
1
2
3
4
5
...
 
 
1
2
3
0
@@ -1,5 +1,3 @@
0
-#!/usr/bin/env ruby
0
-
0
 EVAL_APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__) + "/.."))
0
 ["extras","bin","worker","lib"].each { |x| $LOAD_PATH.unshift(EVAL_APP_ROOT + "/#{x}")}
0
 
...
46
47
48
49
 
50
51
52
...
46
47
48
 
49
50
51
52
0
@@ -46,7 +46,7 @@ module Packet
0
 
0
     def ask_worker(*args)
0
       worker_name = args.shift
0
- data_options = *args
0
+ data_options = args.last
0
       data_options[:client_signature] = connection.fileno
0
       t_worker = reactor.live_workers[worker_name]
0
       raise Packet::InvalidWorker.new("Invalid worker with name #{worker_name} and key #{data_options[:data][:worker_key]}") unless t_worker
...
108
109
110
111
112
 
 
113
114
115
...
108
109
110
 
 
111
112
113
114
115
0
@@ -108,8 +108,8 @@ module Packet
0
         [master_write_end,master_read_end].each { |x| x.close }
0
         [worker_read_end,worker_write_end].each { |x| enable_nonblock(x) }
0
         begin
0
- if(ARGV[0] == 'start' && !worker_options[:disable_log])
0
- log_file = File.open("log/#{worker_name_key}.log","w")
0
+ if(ARGV[0] == 'start' && const_defined?(:SERVER_LOGGER))
0
+ log_file = File.open(SERVER_LOGGER,"w")
0
             [STDIN, STDOUT, STDERR].each {|desc| desc.reopen(log_file)}
0
           end
0
         rescue; end
...
13
14
15
16
17
18
19
20
21
22
23
24
 
 
25
26
27
...
13
14
15
 
 
 
 
 
 
 
 
 
16
17
18
19
20
0
@@ -13,15 +13,8 @@ module Packet
0
     def read_data(t_sock)
0
       sock_data = []
0
       begin
0
- if RUBY_PLATFORM =~ /linux/i
0
- while(t_data = t_sock.read_nonblock((16*1024)-1))
0
- sock_data << t_data
0
- end
0
- else
0
- while(t_data = t_sock.recv_nonblock((16*1024)-1))
0
- raise DisconnectError.new(t_sock,sock_data.join) if t_data.empty?
0
- sock_data << t_data
0
- end
0
+ while(t_data = t_sock.read_nonblock((16*1024)-1))
0
+ sock_data << t_data
0
         end
0
       rescue Errno::EAGAIN
0
         return sock_data.join

Comments

    No one has commented yet.