Get perticular Event of Socket with RTCS_selectall

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

Get perticular Event of Socket with RTCS_selectall

ソリューションへジャンプ
989件の閲覧回数
utsavikalpesh
Contributor V

Hi

I am working with CodeWarrior v10.6 and of MQX v4.0.

In my project my module TWR-K60D100M(Server) is connected with 2 PC with LAN Connection.

Now using selectall(), Currenlty I am getting the Event of Connection of any PC(Listening Activity of Server). Also as per I read MQXRTCSUG, selectall() is providing any activity done on Connected Stream like Data or Shutdown requests that are initiated by the remote endpoint.

But what I want to do is if, any PC Close Connection then I want to shutdown its socket.But how can I get Event like any of PC has close the connection?? 

Please help.

Regards,

Utsavi Bharuchwala

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

RTCS_selectall() can't provide you this information, thus, you have to call recv() on a socket with established connection and recv() can tell you this by returning -1 and also by writing appropriate error code into the socket structure (RTCS_geterror()).

If you're starting a new design, I'd strongly recommend to use RTCS 4.2.0 (either MQX 4.2.0 classic or MQX for KSDK 1.2 which has RTCS 4.2.0 too). It has all the latest buf fixes and you can use POSIX like select().

-Martin

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
865件の閲覧回数
Martin_
NXP Employee
NXP Employee

RTCS_selectall() can't provide you this information, thus, you have to call recv() on a socket with established connection and recv() can tell you this by returning -1 and also by writing appropriate error code into the socket structure (RTCS_geterror()).

If you're starting a new design, I'd strongly recommend to use RTCS 4.2.0 (either MQX 4.2.0 classic or MQX for KSDK 1.2 which has RTCS 4.2.0 too). It has all the latest buf fixes and you can use POSIX like select().

-Martin

0 件の賞賛
返信