How to solve socket -23 error while creating multiple server in nRF9160

Hi Support team,

I am  using nRF9160 module and i want run two server on the module, one is modbus server and other is CoAP server. so is it possible to run both server simultaneously ?

Thanks,

Dvl

Parents
  • Hi Dejan Simonovic,

    look like you have not posted complete log file, is network registered successfully ?

    I have tested same code by commented network register process code and i got same log as yours, so i think, network might not registered in your case.

    Please use below log as reference, it shows text during network registration is on going

    *** Booting nRF Connect SDK v3.5.99-ncs1 ***
    [00:00:00.333,648] <inf> main: [142]main
    [00:00:02.605,895] <inf> main: RSP : +CEREG: 0,4
    OK
    
    [00:00:03.614,898] <inf> main: RSP : +CEREG: 0,2,"2BDC","0340830A",7
    OK
    
    [00:00:04.623,931] <inf> main: RSP : +CEREG: 0,2,"2BDC","0340830A",7
    OK
    
    [00:00:05.624,572] <inf> main: RSP : +CEREG: 0,2,"2BDC","0340830A",7
    OK
    
    [00:00:06.625,427] <inf> main: RSP : +CEREG: 0,2,"2BDC","0340830A",7
    OK
    
    [00:00:07.626,007] <inf> main: RSP : +CEREG: 0,1,"2BDC","0340830A",7
    OK
    
    [00:00:07.626,647] <inf> CoAP_APP: coap_service_start : 0
    [00:00:08.626,708] <inf> CoAP_APP: coap_service_is_running : 1
    [00:00:09.626,922] <inf> main: [67]StartTCPServer
    [00:00:09.626,953] <inf> main: Project : CoAPAndServer
    [00:00:09.627,349] <inf> main: [76]StartTCPServer >> socket >> serv >> 3
    [00:00:09.627,685] <inf> main: Started TCP server example on port 502, 0
    [00:00:09.627,716] <err> main: error: accept: 23, -1
    [00:00:09.827,850] <err> main: error: accept: 23, -1
    [00:00:10.027,984] <err> main: error: accept: 23, -1

    thanks,

    Dvl

Reply
  • Hi Dejan Simonovic,

    look like you have not posted complete log file, is network registered successfully ?

    I have tested same code by commented network register process code and i got same log as yours, so i think, network might not registered in your case.

    Please use below log as reference, it shows text during network registration is on going

    *** Booting nRF Connect SDK v3.5.99-ncs1 ***
    [00:00:00.333,648] <inf> main: [142]main
    [00:00:02.605,895] <inf> main: RSP : +CEREG: 0,4
    OK
    
    [00:00:03.614,898] <inf> main: RSP : +CEREG: 0,2,"2BDC","0340830A",7
    OK
    
    [00:00:04.623,931] <inf> main: RSP : +CEREG: 0,2,"2BDC","0340830A",7
    OK
    
    [00:00:05.624,572] <inf> main: RSP : +CEREG: 0,2,"2BDC","0340830A",7
    OK
    
    [00:00:06.625,427] <inf> main: RSP : +CEREG: 0,2,"2BDC","0340830A",7
    OK
    
    [00:00:07.626,007] <inf> main: RSP : +CEREG: 0,1,"2BDC","0340830A",7
    OK
    
    [00:00:07.626,647] <inf> CoAP_APP: coap_service_start : 0
    [00:00:08.626,708] <inf> CoAP_APP: coap_service_is_running : 1
    [00:00:09.626,922] <inf> main: [67]StartTCPServer
    [00:00:09.626,953] <inf> main: Project : CoAPAndServer
    [00:00:09.627,349] <inf> main: [76]StartTCPServer >> socket >> serv >> 3
    [00:00:09.627,685] <inf> main: Started TCP server example on port 502, 0
    [00:00:09.627,716] <err> main: error: accept: 23, -1
    [00:00:09.827,850] <err> main: error: accept: 23, -1
    [00:00:10.027,984] <err> main: error: accept: 23, -1

    thanks,

    Dvl

Children
No Data
Related