Class: Kraken::Godot30Handler

Inherits:
Handler
  • Object
show all
Defined in:
lib/kraken/core/handlers/godot30_handler.rb

Overview

This class made the handler with godot 3.0 To use this handler, setup this line in config file: config.server name: ‘app name’, version: ‘1.0’, handler: :godot_30

Instance Attribute Summary

Attributes inherited from Handler

#connection

Instance Method Summary collapse

Methods inherited from Handler

#close, #initialize, #read_trigger

Constructor Details

This class inherits a constructor from Kraken::Handler

Instance Method Details

#readObject



8
9
10
11
12
13
14
# File 'lib/kraken/core/handlers/godot30_handler.rb', line 8

def read
  string_length = @socket.read(4).unpack('L<').first
  raise 'connection lost' if string_length.nil?
  line = @socket.read(string_length)
  raise 'connection lost' if line.nil?
  line.chomp
end