~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to vio/viotest.cc

  • Committer: Monty Taylor
  • Date: 2008-11-07 04:45:58 UTC
  • mfrom: (574.3.4 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 579.
  • Revision ID: monty@inaugust.com-20081107044558-2me2c70ksfr3qs9i
Merged from Lee (and from trunk by proxy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
2
 
**  Virtual I/O library
3
 
**  Written by Andrei Errapart <andreie@no.spam.ee>
4
 
*/
5
 
 
6
 
#include        "all.h"
7
 
 
8
 
#include        <sys/types.h>
9
 
#include        <sys/stat.h>
10
 
#include        <stdio.h>
11
 
 
12
 
#include        <string.h>
13
 
 
14
 
VIO_NS_USING;
15
 
 
16
 
int
17
 
main(   int     argc,
18
 
        char**  argv)
19
 
{
20
 
        VioFd*  fs = 0;
21
 
        VioSocket*      ss = 0;
22
 
        int             fd = -1;
23
 
        char*           hh = "hshshsh\n";
24
 
 
25
 
        fd = open("/dev/tty", O_WRONLY);
26
 
        if (fd<0)
27
 
        {
28
 
                perror("open");
29
 
                return 1;
30
 
        }
31
 
        fs = new VioFd(fd);
32
 
        ss = new VioSocket(fd);
33
 
        if (fs->write(hh,strlen(hh)) < 0)
34
 
                perror("write");
35
 
        ss->write(hh,strlen(hh));
36
 
        printf("peer_name:%s\n", ss->peer_name());
37
 
        printf("cipher_description:%s\n", ss->cipher_description());
38
 
        delete fs;
39
 
        delete ss;
40
 
 
41
 
        return(0);
42
 
}
43