RTCS web server not responding with separate socket server running

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

RTCS web server not responding with separate socket server running

534 Views
jcolyn
Contributor I

As the title says, 

 

I am trying to impliment a program that hosts a web server, as well as running a TCP socket server in a seperate task.

 

Problem:

Both the Socket server and the web server run in isolation, but as soon as a client connects to the TCP server, the web server no longer detects any new queries, and stops responding to current conected sessions.

 

I am able to debug and can confirm that both tasks are running, so i dont think it is a memory issue.

 

I have tried using selectset(), selectall() and also niether of these calls (just creating a blocking accept() call) for the TCP server.

 

I am running in minimum memory mode (small ram config), and have set PCB, msg_pool and socket_part settings to allow for many simultanious socket connections (8).

 

Hardware: M52235evb and a router, all with static IPs.

Software: CW10.2 eclipse, MQX 3.8

 

Most of my code resembles that of the example programs included with MQX, or from the pdf files included.

 

Any help or ideas will be appreciated,

 

Thanks.

Labels (1)
Tags (1)
0 Kudos
1 Reply

210 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Jaco,

Are you adding enough sockets for your application? The web_hvac demo application is a good example of how to implement this.

Take a look to the file:

C:\Program Files\Freescale\Freescale MQX 3.8\demo\web_hvac\RTCS.c

It adds the next lines:

    _RTCSPCB_init = 4;

    _RTCSPCB_grow = 2;

    _RTCSPCB_max = 20;

    _RTCS_msgpool_init = 4;

    _RTCS_msgpool_grow = 2;

    _RTCS_msgpool_max  = 20;

    _RTCS_socket_part_init = 4;

    _RTCS_socket_part_grow = 2;

    _RTCS_socket_part_max  = 20;

These lines will ensure you to have at least 4 sockets available in the system. Remember that your server will already take one, so you will have 3 remain sockets with this configuration settings. Also remember to close those sockets that already finished the client connection in the server side (your board)

I hope this helps you.

Garabo

0 Kudos