Changeset 12 in chevmsgr for trunk/msgclnt.h


Ignore:
Timestamp:
08/30/15 15:08:31 (9 years ago)
Author:
cheese
Message:

add dialogs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/msgclnt.h

    r8 r12  
    2121} SConversation;
    2222
     23typedef struct SOpenSession
     24{
     25    std::string sessid;
     26    std::vector<std::string> idList;
     27} SOpenSession;
     28
     29typedef struct SCallback
     30{
     31    int(*onChat)(SConversation &);
     32    int(*onOpenSession)(SOpenSession &);
     33} SCallback;
     34
    2335class MessageQ
    2436{
     
    2840
    2941public:
    30     void push(const Protocol::Message & parser);
     42    void push(const Protocol::Message & message);
    3143
    32     Protocol::Message pop(const std::string & requestType);
     44    Protocol::Message pop(const std::string & requestType, bool isWait = true);
    3345};
    3446
     
    4052    cf::network::tcp    socket;
    4153    cf::task::thread    listener;
     54    cf::task::thread    caller;
    4255
    4356    MessageQ            messageQ;
     
    6881    bool tell(const SConversation & conversation);
    6982
    70     SConversation listen();
     83    bool listen(const SCallback & callback);
    7184};
Note: See TracChangeset for help on using the changeset viewer.