summaryrefslogtreecommitdiff
path: root/docs/tutorials/015/Crypt.h
blob: c7fb1d5948f5a60c18a89b560d9c75860b6d114f (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
35

// $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