sctplab / sctp-refimpl

Automatically exported from code.google.com/p/sctp-refimpl
BSD 2-Clause "Simplified" License
8 stars 2 forks source link

Can I get the peer's UDP encapsulation port? #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
All of the examples set up a remote encapsulation port before transmission. But 
can I get the peer's UDP port number from a message? It's necessary for 
Peer-to-Peer networking.

Original issue reported on code.google.com by swordfen...@gmail.com on 4 Jun 2015 at 3:11

GoogleCodeExporter commented 9 years ago
I'm not sure why you think that is needed. Please note that the remote UDP 
encapsulation port is not related to messages, but to a remote peer address. 
Please see
https://tools.ietf.org/html/rfc6951#section-6.1
for a way query it.

Best regards
Michael

Original comment by t00FC...@googlemail.com on 13 Jun 2015 at 9:24

GoogleCodeExporter commented 9 years ago
Thank you for your answer! I tried *struct sctp_udpencaps* in a wrong way last 
time so I failed to get the port number, but now I can get it correctly.
Yes, you're right, as many messages can come from one remote address with one 
encapsulation port. 
In fact, I was making something that needs a udp-like protocol, or is like http 
(without keepalive) which finishes one request in one connection. So I send one 
message per association for just now. (maybe I'll change that in the future)
However, I can get the remote address when recving a message, and then I can 
get the encapsulation port from the address. That's good enough.

Original comment by swordfen...@gmail.com on 14 Jun 2015 at 3:47

GoogleCodeExporter commented 9 years ago
Thanks for the feedback. Closing the issue.

Original comment by t00FC...@googlemail.com on 14 Jun 2015 at 7:33