Link to home
Start Free TrialLog in
Avatar of KouKi
KouKi

asked on

Unix - Fifo

Hello,
I have to make two process communicate via a fifo.
the first program is like a mobile and can send different messages to the second (the server).
the mobile write in the fifo and the server read.

the mobile can send different kinds of messages :
1) a message when it is online :
        - type of message
        - process id
        - phone number
2) a message when it is offline
        - type of message
        - phone number
3) a message to a specific user
        - type of message
        - phone number of the sender
        - phone number of the reciever
        - message

My teacher wants that the mobile send into the fifo a union of 3 structures,
but I don't know how to do this, if someone can help ?
(I heard that for example that in the union he wants the 'type of message' and then in the 3 structures the 'type' need to occur again because they all have a 'type' ... hum ... but i didn't understand very good what he was saying)
thank you (srry need to improve my english as well)
ASKER CERTIFIED SOLUTION
Avatar of grg99
grg99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KouKi
KouKi

ASKER

Thanks I tried it today at school it is working,
I understood the type to select the right structure,
but I don't understand why in each structure I have to put the type one more time ?
> I don't understand why in each structure I have to put the type one more time ?


Because that's what your instructions said!

Actually, now you don't need that type field anymore.
Avatar of KouKi

ASKER

hmm
I know the field type in each structure is still needed because
there would be fields stored at the same adress otherwise.
Anyway thanks for your help :)