error = listen(listensock[0], 0);

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

error = listen(listensock[0], 0);

917 Views
Swapnil_Enable
Contributor III

hi, i have successfully created the server code where i created a socket on the port and put it on listen mode. If any connection comes on this port the a new child socket with same properties is created and connection is establish. but i don't want this socket to connect with child socket, i.e. it should connect to parent socket and should not create a child socket for it. as in my code i have such 13 port and socket, so the memory usages goes to the limit and the code stops working or after connecting +5 ports other ports cannot make any connection and no data txrx is possible in this ports. Please help me understand and solve this problem. Regards, Swapnil K.

Labels (1)
0 Kudos
4 Replies

731 Views
butok
NXP Employee
NXP Employee

Hi  Swapnil Karte,

I am surprised, but the “backlog” parameter of listen(s, backlog) is not implemented and ignored by RTCS.  It is proved by source code and documentation.

So you cannot directly control number of pending connections.

I will make proposal to add the missing implementation to RTCS.


Thanks,

Andrey Butok

731 Views
Swapnil_Enable
Contributor III

Hi Andrey, Sorry but i am not able to follow what you wanna convey. according to the MQXRTSCUG.pdf "Freescale MQX™ RTCS™ User’s Guide, Rev. 8" page 211. Not any more information is given for “backlog” parameter of Listen. i referred example of pg 108. there also the parameter is kept 0. So according to ur proposal the RTCS is incomplete stack, which i should make in observation to my FAE to take care of it? or my code is incomplete? Please elaborate more on this. Regards, Swapnil K.

0 Kudos

731 Views
butok
NXP Employee
NXP Employee

RTCSUG.jpg

Based on the RTCS documentation Rev.10, page 221, Chapter 7.1.105 Listen(), the parameter backlog [in] — Ignored.

So this is the documented feature.

731 Views
Swapnil_Enable
Contributor III

Andery i feel this listen() is solly written for the HTTPD stack inside the RTCS_library. so it is possible to make a http_webserver where we need one port(80) and a possible of around 40 sockets can be open on it. which indeed is quite a good number for an Embedded Server.

0 Kudos