Navigation Menu

Skip to content

Commit

Permalink
Share common value
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 17, 2014
1 parent 678ee12 commit b0f8ea2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/droonga-engine
Expand Up @@ -25,8 +25,8 @@ require "droonga/fluent_message_receiver"
require "droonga/plugin_loader"

options = OpenStruct.new
options.host = Socket.gethostname
options.port = 10031
options.host = Droonga::FluentMessageReceiver::DEFAULT_HOST
options.port = Droonga::FluentMessageReceiver::DEFAULT_PORT
options.tag = "droonga"

parser = OptionParser.new
Expand Down
7 changes: 5 additions & 2 deletions lib/droonga/fluent_message_receiver.rb
Expand Up @@ -25,10 +25,13 @@ module Droonga
class FluentMessageReceiver
include Loggable

DEFAULT_HOST = Socket.gethostname
DEFAULT_PORT = 10031

def initialize(loop, options={}, &on_message)
@loop = loop
@host = options[:host] || "0.0.0.0"
@port = options[:port] || 24224
@host = options[:host] || DEFAULT_HOST
@port = options[:port] || DEFAULT_PORT
@server = nil
@clients = []
@on_message = on_message
Expand Down

0 comments on commit b0f8ea2

Please sign in to comment.