1
/* Copyright (C) 2003 MySQL AB
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.
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.
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 */
17
#include <ndb_global.h>
19
#include <Properties.hpp>
20
#include <socket_io.h>
24
#include "SocketService.hpp"
25
#include "SocketRegistry.hpp"
26
#include "SocketClient.hpp"
27
#include "ClientInterface.hpp"
29
#include <InputStream.hpp>
33
NDB_MAIN(socketclient) {
37
printf("wrong args: socketclient <hostname> <port>\n");
40
const char * remotehost = argv[1];
41
const int port = atoi(argv[2]);
44
ClientInterface * ci = new ClientInterface(2);
45
ci->connectCPCDdaemon(remotehost,port);
47
/*ci->listProcesses(remotehost);
49
ci->startProcess(remotehost, "1247");
51
ci->stopProcess(remotehost, "1247");*/
53
ci->defineProcess(remotehost, "ndb", "ndb-cluster1", "envirnm", "/ndb/bin",
54
"-i", "permanent", "/ndb/ndb.2", "team");
56
ci->startProcess(remotehost, "1247");
58
ci->listProcesses(remotehost);
60
//ci->undefineProcess(remotehost, "1247");
62
ci->disconnectCPCDdaemon(remotehost);