This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bindata' | |
module ServerConnection | |
def receive_data(data) | |
@buffer ||= [] | |
@data_size ||= 0 | |
@current_size ||= 0 | |
if @buffer.empty? | |
# First four characters of any framed message will always be the size of message |