renojim
16 years agoCommunity Streaming Expert
invalid event messages
As I'm sure a lot of you do, I use the statement "msg = wait(0,port)" inside a while loop all over the place. I had assumed that the only way to get past that statement was to have a valid event for whatever component(s) port was associated with. I couldn't figure out why my code would crash on "print type(msg), msg.GetMessage()". After I split the print into two statements, I found out sometimes msg == invalid. That was something I did not expect and I suppose the validity of msg has to be checked every time. I wasn't bothering to check the type of msg if I was only using one type of component and a timeout of 0.
-JT
-JT