httpd server PART:out of blocks(0x0802)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

httpd server PART:out of blocks(0x0802)

1,227 Views
nikhilsarnaik
Contributor III

Hi guyz,

Working on MQX3.8 and used the htpps server example code to host few webpages on the MQX. Now I have to switch between static and dynamic ip address for the server. so need to stop/restart the server.

I used httpd_server_stop(server) to stop the server. but I guess it does not destroy the httpd server task and keeps on creating new "https server" tasks until the block limit is reached and the last task comes up with PART : out of blocks error and the system freezes .

Any help??

Thanks

Labels (1)
Tags (3)
0 Kudos
2 Replies

430 Views
TobiasBystricky
Contributor III

Hi Nikhil,

I thinks its a problem with the minimum footprint settings in rtcs. Try to change following variables in user config:

#define RTCSCFG_SOCKET_PART_GROW                  2

#define RTCSCFG_SOCKET_PART_MAX                   11

After that it works for me.

Best regards,

Tobias

430 Views
nikhilsarnaik
Contributor III

Hi Tobias,

First of all thanks for taking time to answer my question.

I actually had tried that already but that did not work in my case.

Also you can change that config during run time as well by following lines before you instantiate RTSC stack by RTCS_create()

_RTCS_socket_part_grow = 2;

_RTCS_socket_part_max  = 16;


In my case I use httpd_server_run("httpd server") start the server

And when I change the ip address from dhcp to a static or the other way around, I reset the server (if i dont reset server, i cannot see the webpages on new ip address) by something like this

void restart_http_server(){

  uint_32 rtcs_create =0;

  uint_32 error  = 0;

  do{

    error = httpd_server_stop(server);

  }while(error != 0);

    _task_destroy(_task_get_id_from_name("httpd server"));        //destroy the httpd server

    printf("\r\n Unbinding ENET Device...");

    do{

      error = ipcfg_unbind(BSP_DEFAULT_ENET_DEVICE);

    }while(error != IPCFG_OK);

    /* restart the tast */

    printf("\r\n Restarting Server...");

    _task_restart(_task_get_id_from_name("http_serv"),&rtcs_create,FALSE);  //restart the task that started the server

    _time_delay(200);

}

Hope this makes sense

0 Kudos