Skip to content

Commit

Permalink
Better message size upper bound.
Browse files Browse the repository at this point in the history
  • Loading branch information
nning committed Jan 20, 2015
1 parent 463785f commit ced299b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/core/coap/transmission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ def receive(options = {})
flags = mid.nil? ? 0 : Socket::MSG_PEEK

data = Timeout.timeout(timeout) do
@socket.recvfrom(1024, flags)
@socket.recvfrom(1152, flags)
end

answer = CoAP.parse(data[0].force_encoding('BINARY'))

if mid == answer.mid
Timeout.timeout(1) { @socket.recvfrom(1024) }
Timeout.timeout(1) { @socket.recvfrom(1152) }
end

return if answer.nil?
Expand Down

0 comments on commit ced299b

Please sign in to comment.