3 * Copyright (C) 2013-2018 Filipe Coelho <falktx@falktx.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #include "CarlaPipeUtils.hpp"
19 #include "../modules/water/files/File.h"
21 // -----------------------------------------------------------------------
23 class CarlaPipeClient2
: public CarlaPipeClient
27 : CarlaPipeClient() {}
29 bool msgReceived(const char* const msg
) noexcept override
31 carla_stdout("CLIENT RECEIVED: \"%s\"", msg
);
36 class CarlaPipeServer2
: public CarlaPipeServer
40 : CarlaPipeServer() {}
42 bool msgReceived(const char* const msg
) noexcept override
44 carla_stdout("SERVER RECEIVED: \"%s\"", msg
);
49 // -----------------------------------------------------------------------
51 int main(int argc
, const char* argv
[])
55 carla_stdout("CLIENT STARTED %i", argc
);
59 const bool ok
= p
.initPipeClient(argv
);
60 CARLA_SAFE_ASSERT_RETURN(ok
,1);
63 p
.writeMessage("CLIENT=>SERVER\n");
64 p
.writeAndFixMessage("heheheheheh");
69 carla_stderr2("CLIENT idle start");
74 carla_stderr2("CLIENT idle end");
81 carla_stdout("SERVER STARTED %i", argc
);
86 String path
= File(File::getSpecialLocation(File::currentExecutableFile
)).getFullPathName();
88 #ifdef CARLA_OS_WINDOWS
89 path
= "wine " + path
;
93 const bool ok
= p
.startPipeServer(path
.toRawUTF8(), "/home/falktx/Videos", "/home/falktx");
94 CARLA_SAFE_ASSERT_RETURN(ok
,1);
97 p
.writeMessage("SERVER=>CLIENT\n");
102 carla_stderr2("SERVER idle start");
106 carla_stderr2("SERVER idle end");
115 // -----------------------------------------------------------------------
117 #include "../utils/CarlaPipeUtils.cpp"
119 // -----------------------------------------------------------------------