~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to vio/viotest.cc

  • Committer: Monty Taylor
  • Date: 2008-08-05 19:01:20 UTC
  • mto: (266.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 266.
  • Revision ID: monty@inaugust.com-20080805190120-tsuziqz2mfqcw7pe
Removed libmysyslt.la, made mysys a noinst_ and made everything use it. It's
not a standalone lib, there's no reason to pretend otherwise.

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