Browse Source

Can specify which port to run ruby server on.

tags/v1.0^2
Benjamin Attal 10 years ago
parent
commit
73dee778c5
3 changed files with 6 additions and 4 deletions
  1. +1
    -0
      parsers/java/src/main/java/com/bitshift/parsing/Parse.java
  2. +2
    -2
      parsers/ruby/Rakefile
  3. +3
    -2
      parsers/ruby/lib/parse_server.rb

+ 1
- 0
parsers/java/src/main/java/com/bitshift/parsing/Parse.java View File

@@ -6,6 +6,7 @@ public class Parse {

public static void main(String[] args) {
ParseServer server = new ParseServer(Integer.parseInt(args[0]));
System.out.println("Java Server listening on port " + args[0]);
new Thread(server).start();
}



+ 2
- 2
parsers/ruby/Rakefile View File

@@ -1,5 +1,5 @@
require File.expand_path('../lib/parse_server.rb', __FILE__)

task :start_server do |t|
start_server
task :start_server, [:port_number] do |t, args|
start_server Integer(args[:port_number])
end

+ 3
- 2
parsers/ruby/lib/parse_server.rb View File

@@ -13,8 +13,9 @@ def pack_int(i)
end


def start_server
server = TCPServer.new 5065
def start_server(port_number)
server = TCPServer.new port_number
puts "Ruby Server listening on port #{port_number}\n"

loop do
# Start a new thread for each client accepted


Loading…
Cancel
Save