Code Monkey home page Code Monkey logo

coap.net's People

Contributors

lybecker avatar malachib avatar nzsmartie avatar patagonaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coap.net's Issues

CoapResource knowing the RemoteEndpoint

I have a requirement where I need to server to know the origin of the request - the RemoteEndpoint.

The ICoapConnectionInformation is not forwarded from CoapResourceHandler.HandleRequestAsync method to the CoapResource.
I guess it would be a nicer solution if the ICoapConnectionInformation was forward as part of the CoapMessage.

Use observables behind CoapClient.ReceiveAsync

If two contexts are awaiting CoapClient.RecevieAsync(), A newly received message is dequeued and only returned to one of the awaiters. this can become problematic in situations such as using a CoapBlockStream instance that's reading from a CoapClient. it'll drop all messages not intended for the block-wise transfer and may miss out on important blocks if they are received elsewhere.

A proposed solution is making ReceiveAsync subscribe to a observable underneath.
The observer pattern allows all subscribers to receive the same message when it's pushed out.

Option Instances Are Not Encoded In Order

Section 3.1 of [RFC7252] Specifies that each option instance must be encoded in order of their option numbers.

What's not stated in that section but also very important is repeated options must have their order's preserved. (Take UriPath for example).

CoapClient independent from ICoapEndpoint

Perhaps I'm not fully understanding the design, but it CoapClient's lifecycle must be 1:1 with CoapEndpoint. I was expecting a scenario where CoapEndpoint could be a singleton, but multiple CoapClients could come and go.

Based on CoapClient's Dispose code, this is not the case, and my own results confirm it - too many receive async workers stack up and step on each other.

If this is a necessary design choice, then by all means let's do it this way. However, I think it makes more sense to scope CoapClient to be easily transient. What do you think?

EDIT: I may be confusing the notion of ICoapEndpoint with a transport when really perhaps it should be though of as more of an addressing mechanism?

Check for invalid formatting during deserialisation

Message.Deserialise(...) assumes a non-mutated, perfectly formatted message is provided.
If invalid data is provided, it will still try to parse the data and possibly have a fatal failure.

The CoAP specification clearly states multiple scenarios that need to be checked and reject or ignore the message.

Block-Wise Transfers (RFC 7959)

This is an outline of my progress of implementing RFC 7959.

Note: Block1 is request payload to a resource. Block2 is a response from a resource.

CoapClient

  • Block1
    • Sending messages
    • Reduce block size on response
    • Restart Block-Wise transfer on block 0 when received a 4.14 - RequestEntityTooLarge
    • Fail Bloc-kWise transfer on when received a 4.14 - RequestEntityTooLarge
    • Reduce re-transmit attempts
  • Block2
    • Receiving messages
    • Cancel receiving

CoapServer

  • Block2
    • Respond with block-wise transfer.
  • More to add soon

Assistance with custom ICoapEndpoint

Hi, first of all I want to say thank you for the library. I'm a bit of a CoAP nut (see https://github.com/malachi-iot/mc-coap ) and we are utilizing your lib to talk over a fully custom network transport.

We are encountering a mysterious problem where MID (and some other portion, I'm sure) maybe don't match up on responses so we end up doing a ton of retries. I am rather confident this is due to some failing of our own ICoapEndpoint, but I was wondering if you could share any wisdom or thoughts?

Inspection of MID's themselves appear to all be proper

Full disclosure: I write the ICoapEndpoint before realizing that it's an endpoint and transport at once, so all incoming traffic is funneling through one singleton ICoapEndpoint and one singleton CoapClient. However, all these tests are against only one target, so hopefully in the short term that's not too bad. I plan to remedy that scenario in the next round of coding

Swapped UriPath options when using custom ICoapEndpoint

When utilizing a specialized ICoapEndpoint transport layer, what begins as:

UriPath: v1
UriPath: version

in CoapMessage becomes swapped in the outgoing bytes in the CoapPacket I receive during ICoapEndpoint.SendAsync service call. i.e. version appears before v1. UriPath is output in expected order when using Udp endpoint.

Roll a unit-y test just utilizing CoapOption list + CoapMessage.GetBytes to reproduce the issue but that spat out options in expected order. So I'm kinda stumped

It's definitely reproducable in our executing program that we're writing

Document Codebase

Need to go through all the the public API and ensure it is documented for application consumption. The docs will be updated with each release.

Documentation Progress

  • CoAPNet
    • Coap
    • CoapClient
    • CoapClientException
    • CoapEndpoint
    • CoapEndpointException
    • CoapException
    • CoapMessage
    • CoapMessageCode
    • CoapMessageCodeClass
    • CoapMessageFormatException
    • CoapMessageType
    • CoapOption
    • CoapOptionException
    • CoapOptionExtensions
    • CoapPacket
    • CoapReceiveResult
    • CoapRegisteredOptionNumber
    • CoapResource
    • CoapResourceMetadata
    • CoreLinkFormat
    • ICoapConnectionInformation
    • ICoapEndpoint
    • ICoapHandler
    • ICoapTransport
    • ICoapTransportFactory
    • MessageExtensions
    • Options
      • Accept
      • ContentFormat
      • ContentFormatType
      • ETag
      • Factory
      • IfMatch
      • IfNoneMatch
      • LocationPath
      • LocationQuery
      • MaxAge
      • ProxyScheme
      • ProxyUri
      • Size1
      • UriHost
      • UriPath
      • UriPort
      • UriQuery
    • OptionType
    • Utils
      • AsyncAutoResetEvent
      • CoapMessageUtility
      • CoapUri
  • CoAPNet.Server
    • CoapHandler
    • CoapLoggingEvents
    • CoapResourceCoreListing
    • CoapResourceHandler
    • CoapServer
  • CoAPNet.Udp
    • CoapConnectionInformation
    • CoapUdpEndPoint
    • CoapUdpLoggingEvents
    • CoapUdpTransport
    • CoapUdpTransportFactory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.