Skip to content

Instantly share code, notes, and snippets.

@bararchy
Created April 23, 2017 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bararchy/6f50dacbfe74fc4e452c1bbec4b9d6d0 to your computer and use it in GitHub Desktop.
Save bararchy/6f50dacbfe74fc4e452c1bbec4b9d6d0 to your computer and use it in GitHub Desktop.
slecet
def buffer_from_socket
buff = "" # buffer is empty
while IO.select([socket], nil,nil,5)
read_and_add_to_buff
end
return buff
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment