Get perticular Event of Socket with RTCS_selectall

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

Get perticular Event of Socket with RTCS_selectall

Jump to solution
417 Views
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 Kudos
1 Solution
292 Views
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

View solution in original post

0 Kudos
1 Reply
293 Views
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 Kudos