Changeset 68d94de in network-game for common/MessageProcessor.h


Ignore:
Timestamp:
Dec 24, 2013, 3:02:22 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
8554263
Parents:
e1af80c
Message:

MessageProcessor now takes a socket and optional output log file as constructor arguments instead of accepting them as parameters in each method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/MessageProcessor.h

    re1af80c r68d94de  
    1010class MessageProcessor {
    1111private:
     12   int sock;
     13   ofstream* outputLog;
    1214   int lastUsedId;
    1315
     
    1820   map<unsigned long, map<unsigned int, unsigned long long> > ackedMessages;
    1921
    20    unsigned long pid;
     22   //unsigned long pid;
    2123
    2224public:
    2325   MessageProcessor();
     26   MessageProcessor(int sock, ofstream* outputLog = NULL);
    2427   ~MessageProcessor();
    2528
    26    int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest, ofstream* outputLog = NULL);
    27    int receiveMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest, ofstream* outputLog = NULL);
    28    void resendUnackedMessages(int sock, ofstream* outputLog = NULL);
    29    void cleanAckedMessages(ofstream* outputLog = NULL);
     29   int sendMessage(NETWORK_MSG *msg, struct sockaddr_in *dest);
     30   int receiveMessage(NETWORK_MSG *msg, struct sockaddr_in *source);
     31   void resendUnackedMessages();
     32   void cleanAckedMessages();
    3033
    3134   map<unsigned int, map<unsigned long, MessageContainer> >& getSentMessages();
Note: See TracChangeset for help on using the changeset viewer.