lib/server.rb in tg-can-controls-gateway-0.1.0 vs lib/server.rb in tg-can-controls-gateway-0.1.1
- old
+ new
@@ -9,13 +9,11 @@
def post_init
CcgLogger::LOGGER.info "#{Time.now.iso8601} | ++ ... server started"
end
def receive_data(data)
- puts "1"
return unless(CcgRunner.instance.valve == :open)
- puts "2"
##
#CcgLogger::LOGGER.info "#{Time.now.iso8601} | >> raw incoming data: ----------------------"
#CcgLogger::LOGGER.info data.inspect
#CcgLogger::LOGGER.info " --------------------------------------------"
@@ -24,12 +22,16 @@
#port, ip = Socket.unpack_sockaddr_in(get_peername)
#CcgLogger::LOGGER.info "#{Time.now.iso8601} | >> UdpServer: sender: #{ip}, #{port}"
# RCA
rca_dispatching = proc {
- my_dispatcher = CanControlsGateway::OscToRcaDispatcher.new data
- #CcgLogger::LOGGER.info my_dispatcher.event.inspect
- my_dispatcher.dispatch_rca
+ begin
+ my_dispatcher = CanControlsGateway::OscToRcaDispatcher.new data
+ #CcgLogger::LOGGER.info my_dispatcher.event.inspect
+ my_dispatcher.dispatch_rca
+ rescue Exception => e
+ puts " ## #{e}\n -> #{e.backtrace.join "\n "}"
+ end
}
rca_callback = proc { |result|
#if result
# CcgLogger::LOGGER.info "#{Time.now.iso8601} | >> UdpServer: result is: #{result.inspect}"
#end