plgd-dev / go-coap

Implementation of CoAP Server & Client in Go

Home Page:https://coap.technology

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

serve large message

huytn opened this issue · comments

commented

Hi,
I faced an issue is coap server responses large message (>1024bytes) over blockwise transfer but client only get 1024 bytes first. I used libcoap as client.

How to client get full data?

Here is client output

./coap-client -v 8 -m GET -o test01.der coap://localhost:5688/crts
Jul 28 18:16:23.688 DEBG ***[::1]:59146 <-> [::1]:5688 UDP : session 0x7fda05d045b0: created outgoing session
Jul 28 18:16:23.688 DEBG timeout is set to 90 seconds
Jul 28 18:16:23.688 DEBG sending CoAP request:
Jul 28 18:16:23.688 DEBG *  [::1]:59146 <-> [::1]:5688 UDP : sent 23 bytes
v:1 t:CON c:GET i:17e3 {01} [ Uri-Host:localhost, Uri-Port:5688, Uri-Path:crts ]
Jul 28 18:16:23.688 DEBG ** [::1]:59146 <-> [::1]:5688 UDP : mid=0x17e3: added to retransmit queue (3000ms)
Jul 28 18:16:24.948 DEBG *  [::1]:59146 <-> [::1]:5688 UDP : received 1037 bytes
v:1 t:CON c:2.31 i:53ca {01} [ Content-Format:application/octet-stream, Block2:0/M/1024, Size2:1471 ] :: binary data length 1024
<<data>>
<<data>>
Jul 28 18:16:24.949 DEBG ** [::1]:59146 <-> [::1]:5688 UDP : mid=0x17e3: removed 5
Jul 28 18:16:24.949 DEBG ** [::1]:59146 <-> [::1]:5688 UDP : large body receive internal issue
Jul 28 18:16:24.949 DEBG *  [::1]:59146 <-> [::1]:5688 UDP : sent 4 bytes
v:1 t:ACK c:0.00 i:53ca {} [ ]
Jul 28 18:16:24.950 DEBG *  [::1]:59146 <-> [::1]:5688 UDP : received 4 bytes
v:1 t:ACK c:0.00 i:17e3 {} [ ]
Jul 28 18:17:53.690 INFO timeout
Jul 28 18:17:53.691 DEBG ***[::1]:59146 <-> [::1]:5688 UDP : session 0x7fda05d045b0: closed

Thanks

Hi. Could you use it with the token? v2 current use the token for matching in BW transfer. (BW without token will be fixed in some minor update of v3)

commented

There could be an issue with libcoap. I fixed this issue.
Thanks