Welcome, Guest. Please login or register.

Author Topic: Problem tagging (typifing) a message and type nt_ReplyedMessage  (Read 2099 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Hi. Yet another dillema here. I'm using just one port to receive various types of messages and I want to have a way of recognizing each. 2 ways I thought, 1-have a field in the message structure created by me for type, 2-use the node on the message itself wich has a field to specify the type.
First of all 1 won't work, because some of the messages are replyed and from the includes there's a node type nt_ReplyedMessage or something that gets set when a message is replyed, thus changing the type. So this would invalidade the option of using the node type field.
Second, 2 won't work easily either, because some of the messages are device requests, so even if I extended them with additional fields the offsets would be different for some messages.

The solution is to use more than one message port, one for each device request (just timer for now but could be more in the future..) and another for my own messages and Waiting for the combination their signals.

But just by curiosity, isn't this a limitation ? Is there a way around it ? ...

:pint:
\\"We made Amiga, they {bleep}ed it up\\"
 

Online Thomas

Re: Problem tagging (typifing) a message and type nt_ReplyedMessage
« Reply #1 on: August 30, 2005, 07:25:18 PM »

You could try to use the ln_Name field. I doubt that it is used by the IORequest.

However, what you try to do is more than suspect. Device I/O is a private issue, you should only use WaitIO to remove messages from the port. If you do it with GetMsg, some parts of the I/O protocol might not get done. The easiest is to use a different port for each IORequest.

Bye,
Thomas

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Re: Problem tagging (typifing) a message and type nt_ReplyedMessage
« Reply #2 on: August 31, 2005, 06:10:08 PM »
Well I could use Wait and then WaitIO right ?...  But I already changed the code to use different ports last night, it's easier given what I want to do.

:pint:
\\"We made Amiga, they {bleep}ed it up\\"
 

Online Thomas

Re: Problem tagging (typifing) a message and type nt_ReplyedMessage
« Reply #3 on: August 31, 2005, 07:07:41 PM »
Quote

Well I could use Wait and then WaitIO right ?


Yes. But WaitIO expects that the message it fetches from the port is the IORequest you gave it as an argument. You cannot Wait, then GetMsg to check what kind of message arrived and then WaitIO to complete the request.

Bye,
Thomas

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Re: Problem tagging (typifing) a message and type nt_ReplyedMessage
« Reply #4 on: August 31, 2005, 07:12:30 PM »
Ah, yes you're right...
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Re: Problem tagging (typifing) a message and type nt_ReplyedMessage
« Reply #5 on: September 02, 2005, 06:06:05 PM »
Hmm, checked the RKM LIbs and it says you can use Wait, WaitPort or WaitIO to wait for device requests. Maybe it's outdated since it's for 2.x only?
\\"We made Amiga, they {bleep}ed it up\\"
 

Online Thomas

Re: Problem tagging (typifing) a message and type nt_ReplyedMessage
« Reply #6 on: September 02, 2005, 07:06:15 PM »

You *can* do:

SendIO();
Wait() or WaitPort();
WaitIO(); /* does not wait again, but fetches the IORequest from the port */

You can *not* do:

SendIO();
Wait() or WaitPort();
GetMsg();
WaitIO();

Bye,
Thomas