How can I close external ports and stop them from responding?

Dear support team,

I created a UDP server using nrf9160 and SLM, but it seems to respond to external accesses automatically.

I don't want it to respond to ports that aren't in use. It's the same with a TCP server.

How can I close external ports and stop them from responding?

Parents Reply Children
  • Hello, 

    Here is the answer I got from our developers:

    TCP RST responses to incoming TCP-connections to closed ports are not really tied to SLM, as it is the modem which automatically sends the RST response. The same functionality will take place when AT+CFUN=1 is called.

    To prevent modem from responding with TCP RST for closed ports (and to ICMP messages, you can use AT#XSOCKETOPT=1,30,1 which sets the  SO_SILENCE_ALL option for the modem. I think the option persists until power offf, but it is probably good idea to call it before AT+CFUN=1.

    As this is a socket option, it will require an open socket to perform. So create one with AT#XSOCKET=1,1,0. It can be closed immediately after SO_SILENCE_ALL is done. That option is not tied to socket, but calling it is.

    Kind regards,
    Øyvind

Related