... | ... | @@ -15,8 +15,6 @@ int main(int argc, char *argv[]) { |
|
|
// Initialise the Cameo application represented by This.
|
|
|
cameo::application::This::init(argc, argv);
|
|
|
|
|
|
// New block to ensure Cameo objects are terminated before the application.
|
|
|
{
|
|
|
// Declare a publisher.
|
|
|
std::unique_ptr<cameo::coms::Publisher> publisher;
|
|
|
|
... | ... | @@ -45,7 +43,6 @@ int main(int argc, char *argv[]) { |
|
|
|
|
|
// Send the end of the stream.
|
|
|
publisher->sendEnd();
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
}
|
... | ... | @@ -90,7 +87,8 @@ public class SubscriberApplication { |
|
|
String data = subscriber.receiveString();
|
|
|
if (data != null) {
|
|
|
System.out.println("received " + data);
|
|
|
} else {
|
|
|
}
|
|
|
else {
|
|
|
break;
|
|
|
}
|
|
|
}
|
... | ... | @@ -107,7 +105,6 @@ public class SubscriberApplication { |
|
|
This.terminate();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
```
|
|
|
|
... | ... | @@ -117,22 +114,14 @@ You can notice the call to *start()* with the "pubcpp" name that is not already |
|
|
Here is a possible configuration file *config.xml*:
|
|
|
```xml
|
|
|
<config port="7000">
|
|
|
|
|
|
<applications>
|
|
|
|
|
|
<!-- The C++ application with name pubcpp -->
|
|
|
<application name="pubcpp" log_directory="logs">
|
|
|
<start executable="pubcppapp"/>
|
|
|
</application>
|
|
|
|
|
|
|
|
|
<!-- The Java application with name subpubjava -->
|
|
|
<application name="subpubjava" log_directory="logs">
|
|
|
<start executable="java" args="-classpath tests.jar test.SubscriberApplication"/>
|
|
|
</application>
|
|
|
|
|
|
</applications>
|
|
|
|
|
|
</config>
|
|
|
```
|
|
|
A Cameo server configuration file contains:
|
... | ... | |