Comments (5)
Pls could you try to use go-coap/v2 . This version allows you to set any option.
from go-coap.
I was able to confirm that this works in v2!
from go-coap.
Thx for info ;).
from go-coap.
I'm trying to put together a sample using the new V2 syntax and I'm finding a few different ways to construct a request. If I create a connection using udp.Dial()
, how should I generate the message options for say a Get()
? One challenge is that there is no NewMessage()
if connection is created with udp.
, unlike coap.
.
Forgive me if that's a naive q, still a novice Gopher here :)
from go-coap.
No problem. This is a example for udp - for tcp it is very similar (just replace string udp by tcp in import).
import "github.com/go-ocf/go-coap/v2/udp/message/pool"
...
c, err := udp.Dial("127.0.0.1:1234")
req := pool.AcquireMessage(ctx)
req.SetCode(code)
req.SetToken(token)
req.SetPath(path)
req.AddQuery("if=abc")
req.SetOptionBytes
req.SetOptionString
req.AddOptionString
req.SetOptionUint32
req.AddOptionUint32
...
resp, err := c.Do(req) // or err := c.WriteMessage(req)
...
from go-coap.
Related Issues (20)
- Consume `pion/dtls` connection ID support HOT 1
- Support serializing and deserializing a UDP DTLS connection HOT 2
- Implement Support for Separate Messages in Server HOT 1
- Server response with ACK to Empty CON (CoAP Ping) HOT 1
- /examples/dtls/cid/server crashes if client has wrong PSK HOT 1
- udp/server_test.go fails if first non-loopback interface is not running HOT 2
- Media type strings do not match IANA registry HOT 5
- Mux provides user with internal map HOT 1
- Ping (CON Empty Message) Notifications HOT 1
- Support for sending messages without token
- Blockwise requests should be correlated based on message options HOT 4
- ListenAndServeWithOptions doesn't correctly start UDP server HOT 1
- Pion pkg/net dependency error HOT 3
- No `NSTART` parameter in TCP transport HOT 2
- Cannot send non-confirmable responses over blockwise udp connection HOT 1
- Custom response messages with type set to ACK send CON HOT 1
- Message cache conflict on block wise transfers with many chunks
- Observe timeout
- Combination of blockwise and observe not working
- Example Server UDP: sendmsg: invalid argument HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-coap.