/* chat.idl Written by: Stuart Hansen Date: February 3, 2009 This file contains the idl code for a CORBA chat application. */ module chatpkg { // The Message struct contains all information for passing // messages to the server and from the server to the clients. struct Message { string sender; string messageText; }; // A ChatClient sends and receives messages only with the server. // Other client communicate with this client via the server. interface ChatClient { // Receive a message that a client is registered with the server oneway void newClientNotification (in string clientName); // Receive a message that a client has deregistered with the server oneway void clientUnregisteredNotification (in string clientName); // Receive a message from antoher client via the server oneway void sendMessageToClient (in Message message); // Receive a whispered message from another client via the server oneway void whisperMessageToClient (in Message message); }; // The ChatServer has methods to register/unregister ChatClients // and to receive messages from Clients. interface ChatServer { // Register a new ChatClient // return values // 0 = taken // 1 = ok */ long register (in string clientName); // Unregister a ChatClient oneway void unregister (in string clientName); // Post a message to all registered clients oneway void post (in Message message); // Whisper a message to one other client oneway void whisper (in string clientName, in Message message); }; };