~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to storage/ndb/src/cw/test/socketclient/socketClientTest.cpp

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2013-12-22 10:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20131222102705-mndw7s12mz0szrcn
Tags: upstream-5.5.32
Import upstream version 5.5.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA */
 
15
 
 
16
 
 
17
#include <ndb_global.h>
 
18
#include <NdbOut.hpp>
 
19
#include <Properties.hpp>
 
20
#include <socket_io.h>
 
21
#include <NdbTick.h>
 
22
#include <NdbMain.h>
 
23
#include <NdbSleep.h>
 
24
#include "SocketService.hpp"
 
25
#include "SocketRegistry.hpp"
 
26
#include "SocketClient.hpp"
 
27
#include "ClientInterface.hpp"
 
28
 
 
29
#include <InputStream.hpp>
 
30
 
 
31
#include <Parser.hpp>
 
32
 
 
33
NDB_MAIN(socketclient) {
 
34
  
 
35
  
 
36
  if(argc<3) {
 
37
    printf("wrong args: socketclient <hostname> <port>\n");
 
38
    return 0;
 
39
  }
 
40
  const char * remotehost = argv[1];
 
41
  const int port   = atoi(argv[2]);
 
42
  
 
43
  
 
44
  ClientInterface * ci = new ClientInterface(2);
 
45
  ci->connectCPCDdaemon(remotehost,port);
 
46
 
 
47
  /*ci->listProcesses(remotehost);
 
48
 
 
49
  ci->startProcess(remotehost, "1247"); 
 
50
 
 
51
  ci->stopProcess(remotehost, "1247");*/
 
52
 
 
53
  ci->defineProcess(remotehost, "ndb", "ndb-cluster1", "envirnm", "/ndb/bin", 
 
54
                    "-i", "permanent", "/ndb/ndb.2", "team");
 
55
 
 
56
  ci->startProcess(remotehost, "1247"); 
 
57
 
 
58
  ci->listProcesses(remotehost);
 
59
 
 
60
  //ci->undefineProcess(remotehost, "1247");
 
61
 
 
62
  ci->disconnectCPCDdaemon(remotehost);
 
63
}