- badhic
- Member
- Registered: 2015-05-29
- Posts: 4
How to know message type
Hello,
Please, is there a way to know the type of a received message, and so is it possible to use different types of messages at the same time.
thank you for help.
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
/home/clients/7e4bc2f7e893962ca21d7e305619d422/web/madkit/forum/include/parser.php on line
821
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
/home/clients/7e4bc2f7e893962ca21d7e305619d422/web/madkit/forum/include/parser.php on line
821
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
/home/clients/7e4bc2f7e893962ca21d7e305619d422/web/madkit/forum/include/parser.php on line
821
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
/home/clients/7e4bc2f7e893962ca21d7e305619d422/web/madkit/forum/include/parser.php on line
821
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
/home/clients/7e4bc2f7e893962ca21d7e305619d422/web/madkit/forum/include/parser.php on line
821
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
/home/clients/7e4bc2f7e893962ca21d7e305619d422/web/madkit/forum/include/parser.php on line
821
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
/home/clients/7e4bc2f7e893962ca21d7e305619d422/web/madkit/forum/include/parser.php on line
821
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
/home/clients/7e4bc2f7e893962ca21d7e305619d422/web/madkit/forum/include/parser.php on line
821
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
/home/clients/7e4bc2f7e893962ca21d7e305619d422/web/madkit/forum/include/parser.php on line
821
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in
/home/clients/7e4bc2f7e893962ca21d7e305619d422/web/madkit/forum/include/parser.php on line
821
- fmichel
- Administrator
- From: Montpellier
- Registered: 2009-03-24
- Posts: 178
- Website
Re: How to know message type
Hello,
Since an agent may send and receive any kind of messages, you have to test that the message is of a particular expected type. Example:
Message m = waitNextMessage();
if (m instanceof GUIMessage) {
treat((GUIMessage) m);
}
else
if (m instanceof KernelMessage) {
treat((KernelMessage) m);
}
else
if (logger != null)
logger.warning("I received a message that I do not understand. Discarding "
+ m);
}
Therefore it is of course possible to use different types of messages at the same time.
- badhic
- Member
- Registered: 2015-05-29
- Posts: 4
Re: How to know message type
Thank you !
you save me a lot of time