Properly coded multi client TCP server (threads) ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Properly coded multi client TCP server (threads) ?

ソリューションへジャンプ
1,154件の閲覧回数
robroz
Contributor III

Hi,

I'd like to implement TCP server that would allow more than one client to connect on TCP socket.

First question is how server figures out that client has disconnected ?

Second is how to write robust TCP server that would allow connection of more than one client.

Are threads optimal solution? What to put in those threads?

I'd kindly ask if anyone is also willing to post some code examples...

Regards,

Bulek.

0 件の賞賛
返信
1 解決策
930件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Bulek,

By default the MQX examples using Ethernet (MQX4.0/demo/web_hvac or the MQX4.0/rtcs/examples/httpsrv) can have more than one client access them.

The default setting for the RTCSCFG_TCP_MAX_CONNECTIONS is 0 (which means there is no limit).

If you want to change this #define setting do it in the user_config.h header and recompile the RTOS components.

Obviously an infinite number of connections cannot occur.  Just realize each connection used up a certain amount of RAM and sooner or later you will run out.

Regards,

David

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
931件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Bulek,

By default the MQX examples using Ethernet (MQX4.0/demo/web_hvac or the MQX4.0/rtcs/examples/httpsrv) can have more than one client access them.

The default setting for the RTCSCFG_TCP_MAX_CONNECTIONS is 0 (which means there is no limit).

If you want to change this #define setting do it in the user_config.h header and recompile the RTOS components.

Obviously an infinite number of connections cannot occur.  Just realize each connection used up a certain amount of RAM and sooner or later you will run out.

Regards,

David

0 件の賞賛
返信