summaryrefslogtreecommitdiff
path: root/docs/tutorials/015/Crypt.h
blob: 60aa82f69bd2706cf8e9ff4c04a46f928a423407 (plain)
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
// $Id$

#ifndef CRYPT_H
#define CRYPT_h

#include "Protocol_Task.h"

/* An interface (adaptor) between your favorite encryption method and
   an ACE_Stream.
*/
class Crypt : public Protocol_Task
{
public:

  typedef Protocol_Task inherited;

  // Again we have the option of multiple threads and again I
  // regret tempting folks to use it.
  Crypt (int thr_count = 0);

  ~Crypt (void);

protected:

  // Moving downstream will encrypt the data
  int send (ACE_Message_Block *message,
            ACE_Time_Value *timeout);

  // And moving upstream will decrypt it.
  int recv (ACE_Message_Block *message,
            ACE_Time_Value *timeout);
};

#endif /* CRYPT_H */