ruby - EventMachine - Port is in use -


getting port in use error.

require 'em-websocket' em.run {     em::websocket.run(:host => "192.168.1.100", :port => 9001) |ws|         # code goes here...     end } 

then on same server @ same time different ip address:

require 'em-websocket'  em.run {     em::websocket.run(:host => "192.168.1.101", :port => 9001) |ws|         # code goes here...     end } 

then error... ports should bound separate ip addresses, , available use.

/usr/local/rvm/gems/ruby-1.9.3-p194/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in 'start_tcp_server': no acceptor (port in use or requires root privileges) (runtimeerror)

am missing something?

update:

running: netstat -tulpn | grep ruby shows:

tcp        0      0 0.0.0.0:9001                0.0.0.0:*                   listen      718/ruby 

clearly shows server bound 0.0.0.0 , not 192.168.1.100

how can eventmachine bind 192.168.1.100?

seems bug...

afaik 0.0.0.0:9001 means port bound on every available ip address. conflicting 192.168.1.100:9001.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -