File: ArServerClientData.h

package info (click to toggle)
libaria 2.8.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 13,628 kB
  • ctags: 16,574
  • sloc: cpp: 135,490; makefile: 925; python: 597; java: 570; ansic: 182
file content (40 lines) | stat: -rw-r--r-- 1,122 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef ARSERVERCLIENTDATA_H
#define ARSERVERCLIENTDATA_H

#include "Aria.h"

class ArServerClientData
{
public:
  ArServerClientData(ArServerData *serverData, long mSecInterval, 
		     ArNetPacket *packet)
    {
      myServerData = serverData; 
      myMSecInterval = mSecInterval;
      myPacket.duplicatePacket(packet);
      myReadLength = myPacket.getReadLength();
      myLastSent.setToNow();
    }
  virtual ~ArServerClientData() {}
  ArServerData *getServerData(void) { return myServerData; }
  long getMSec(void) { return myMSecInterval; }
  ArNetPacket *getPacket(void) 
    { myPacket.setReadLength(myReadLength); return &myPacket; }
  ArTime getLastSent (void) { return myLastSent; }
  void setLastSentToNow(void) { myLastSent.setToNow(); }
  void setMSec(long mSec) { myMSecInterval = mSec; }
  void setPacket(ArNetPacket *packet) 
    { 
      myPacket.duplicatePacket(packet); 
      myReadLength = myPacket.getReadLength();
    }
protected:
  ArServerData *myServerData;
  long myMSecInterval;
  ArNetPacket myPacket;
  unsigned int myReadLength;
  ArTime myLastSent;

};

#endif // ARSERVERCLIENTDATA_H