Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Original address #40

Merged
merged 5 commits into from
Feb 17, 2015
Merged

Original address #40

merged 5 commits into from
Feb 17, 2015

Conversation

dmoranj
Copy link
Collaborator

@dmoranj dmoranj commented Feb 16, 2015

Add a property in the response listener for the requests to allow the caller to retrieve information about the socket used in the communication (port, address and protocol). This addition was motivated by the need of identifying the device original address in COAP-based OMA Lightweight M2M protocol as explained in issue #39 (originally the need was to use the same socket for listening and sending requests, but having information about the registration socket might lead to avoid the sharing, as explained in a comment).

I choose to expose the information as part of the rsinfo object (that was already passed to the IncomingMessage instance creation) and expose the latter in a _rsinfo internal attribute of the response, but I'm not 100% confident this is the best option. It covers the functionality specified in the issue, though.

@mcollina
Copy link
Collaborator

I'm ok with adding that visibility of the local address, however, I am not sure that _rsinfo is the right place for it. I would likely expose the rsinfo as rsinfo as it would become part of the external interface, and document that in the README. But I would also keep that untouched (as from the UDP socket itself) and add one more property.

Also, you would need to add them to https://github.com/mcollina/node-coap/blob/master/lib/observe_read_stream.js.

@dmoranj
Copy link
Collaborator Author

dmoranj commented Feb 16, 2015

Ok. I'll expose the rsinfo as is and the outgoing socket as an outSocket one, and add the docs for both.

@dmoranj
Copy link
Collaborator Author

dmoranj commented Feb 16, 2015

Information about both sockets exposed as external attributes and added to their respective sections in the documentation.

mcollina added a commit that referenced this pull request Feb 17, 2015
@mcollina mcollina merged commit 6c898a1 into coapjs:master Feb 17, 2015
@mcollina
Copy link
Collaborator

@dmoranj are you ok to become a collaborator of this project? Have a look at https://github.com/mcollina/node-coap/blob/master/CONTRIBUTING.md and let me know!

@dmoranj
Copy link
Collaborator Author

dmoranj commented Feb 23, 2015

Sorry, didn't read this message until now. Yes, I would like to become a collaborator (I guess I'll be working extensively with COAP in the next months, so I hope I'll have time to contribute).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants