NCS 2.9.0 - nRF9151 mfw 2.0.2 - getsockname not supported?

Is it possible to get to port of an UDP socket (ephemeral, offloaded to modem) with NCS 2.9.0 and mfw 2.0.2?

I tried "getsockname" and get "errno 95 (Operation not supported on socket)".

According zephyr - net: getsockname: fails for bound socket it should be working and fixed for zephyr.

Though I use a modem, it seems that it's not possible to use that.

Is there an there function in NCS?

Parents
  • Hello, 

    and my apologies for the late reply. I was writing an answer on Friday but did not send. 

    The reason for getting errno 95 is due to fact that getsockname is not defined in our lib: nrf\lib\nrf_modem_lib\nrf9x_sockets.c

    Our developers inform me that getsockname is not supported, and ask for a use case. Could you please provide more details for our developers to understand the use case?

    Thank you.

    Kind regards,
    Øyvind

Reply
  • Hello, 

    and my apologies for the late reply. I was writing an answer on Friday but did not send. 

    The reason for getting errno 95 is due to fact that getsockname is not defined in our lib: nrf\lib\nrf_modem_lib\nrf9x_sockets.c

    Our developers inform me that getsockname is not supported, and ask for a use case. Could you please provide more details for our developers to understand the use case?

    Thank you.

    Kind regards,
    Øyvind

Children
  • > and ask for a use case. Could you please provide more details for our developers to understand the use case?

    That depends more on what is considered to be an "valid use-case".

    I would like to receive some UDP data on the device when using eDRX.

    One requirement for that is to know the (UDP) port. There are different ways to get that, one is just to bind the socket to a provided port, the other one would be to use the source-port of a received message. Both have pros and cons (e.g. considering, that the traffic take two different routes, one through the public internet, one through a VPN). All in all, it will add some flexibility, to be able to use ephemeral ports and be able to get that assigned port.

    It's not that important, for now I'm able to work with a specific provided port, but the getsockname would complete the possibilities and makes zephyr apps more portable.

Related