How to check if a GLXcontext is remote or local - unix

I'm experiencing problems since I'm calling cuGLGetDevices() on an application which uses the glXGetCurrentContext (https://www.opengl.org/sdk/docs/man2/xhtml/glXGetCurrentContext.xml) function to query an OpenGL context. The context must be local and not remote via ssh for my app to work properly.
Is there any way I can detect if the context is remote or local?

You need to use glXIsDirect function

Related

GetTwinAsync() are not supported in IoT edge Simulator v0.14.10

GetTwinAsync() returns always Twin object with empty properties, all properties of my IoT edge module are null when I run my IoT edge device in Simulator, in my Linux server works everything fine. I should wait also about 20 seconds to get a response from GetTwinAync().
If we look at it, this problem is expected. If you read this Understand and use module twins in IoT Hub document, then you will see that from module app, only has permission to read desired properties and read/write reported properties. If you check this image below you will understand better.
The lifecycle of a module twin is linked to the corresponding module identity. Modules twins are implicitly created and deleted when a module identity is created or deleted in IoT Hub.
To access all module properties, you can do it from solution back end and require the ServiceConnect permission. You will need Microsoft.Azure.Devices V1.16.0-preview-001 or later. The following is a console app code snippet.
...
RegistryManager registryManager = RegistryManager.CreateFromConnectionString(connectionString);
Module module;
try
{
module = await registryManager.AddModuleAsync(new Module(deviceID, moduleID));
}
catch (ModuleAlreadyExistsException)
{
module = await registryManager.GetModuleAsync(deviceID, moduleID);
}
...
For more detailed explanation and example check this Get started with IoT Hub module identity and module twin (.NET). If your issue still persist then you can open an issue on azure-iot-sdk-csharp repository.

No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/NetworkManager/ActiveConnection/

I start my qt application in the user's .profile file (not root) to make the app start on boot. Sometimes when my application start, it reports an warning as below:
"No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/NetworkManager/ActiveConnection/1"
I searched on google but did not find a explanation.
It seems my app is still working fine, but I want to locate the problem.
The application is running on ubuntu and using Qt5.
Thanks in advance.
Edit
I tried to debug dbus based on Eligijus Pupeikis's help with running:
gdbus introspect --system \
--dest org.freedesktop.NetworkManager \
--object-path /org/freedesktop/NetworkManager/ActiveConnection
it returns:
node /org/freedesktop/NetworkManager/ActiveConnection {
node 0 {
};
};
So, this means there is no such object just as the error message said, right?
And also, this gns3 team member says this problem is about Qt and Ubuntu.
Does this mean I don't need to solve it? I not familiar with the relationship between dbus and qt.
Most likely there is no such object "/org/freedesktop/NetworkManager/ActiveConnection/1" and because of that it can't find 'org.freedesktop.DBus.Properties' interface.
From documentation org.freedesktop.NetworkManager.Connection.Active :
Objects that implement the Connection.Active interface represent an attempt to connect to a network using the details provided by a Connection object. The Connection.Active object tracks the life-cycle of the connection attempt and if successful indicates whether the connected network is the "default" or preferred network for access. NetworkManager has the concept of connections, which can be thought of as settings, a profile or a configuration that can be applied on a networking device. Such settings-connections are exposed as D-Bus object and the active-connection expresses this relationship between device and settings-connection. At any time a settings-connection can only be activated on one device and vice versa. However, during activation and deactivation multiple active-connections can reference the same device or settings-connection as they are waiting to be activated or to be deactivated.
You can't know that that ActiveConnection object with specifically index 1 exists so you need to check by reading ActiveConnections property from /org/freedesktop/NetworkManager object's org.freedesktop.NetworkManager interface.
To have better visualize and understand how it looks I suggest D-Bus debugger. If you are using Gnome check out D-Feet.

How to build a MeteorJs application server-side only?

i'm refactoring an application build when meteor was in 0.5.x
I need to scale the application, so i will now have different applications able to run on different core. One of them will be dedicated to web-application, but others are server only. For those case i don't want Meteor to serve anything, it must not be an http server.
I tried to configure differently the package list (file .meteor/packages:
# standard package of meteor-platform in server app only
application-configuration
autoupdate
base64
binary-heap
callback-hook
check
ddp
deps
ejson
follower-livedata
geojson-utils
id-map
json
logging
meteor
mongo
observe-sequence
ordered-dict
random
retry
routepolicy
# standard package of meteor-platform in client app
#blaze
#blaze-tools
#boilerplate-generator
#html-tools
#htmljs
#jquery
#minifiers
#minimongo
#reactive-var
#spacebars
#spacebars-compiler
#templating
#tracker
#ui
#webapp
#webapp-hashing
# specific app package
But when i run #> meteor
Then it tells me that the server is listening, so it doesn't work
I also tried to remove "browser platform" :
meteor remove-platform browser
but it tells me that it cannot remove platform in this version of meteor
Where am i wrong ? the list of packages is not the right one for a server only application ?
Not possible at the moment, "maybe in a future version" as someone from MDG says
Meteor relies on the DDP package to listen to incoming requests and DDP listens on websockets, which is basically http.
Therefore it has to listen for something on some port. If it does not listen, you cannot tell the app to do anything or ask it for anything so then, what use is it?
But if you don't want your app to interfere with your other apps in tems of the ports it binds to, then give it a custom port when you are starting it.
$ meteor run --port 12345

One Flex client connecting to two webapps using BlazeDS - Detected duplicate HTTP-based FlexSessions

I have a flex application that communicates via BlazeDS with two webapps running inside a single instance of Tomcat.
The flex client is loaded by the browser from the first webapp and all is well. However on the initial call to the second webapp the client receives the following error:
Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly.
Subsequent calls to the same service method succeed.
I've seen a few posts around referring to the same error in the context of two flex apps calling a single webapp from the same browser page, but nothing which seems to help my situation - so I'd be very grateful if anyone could help out....
Cheers, Mark
Three potential solutions for you:
I found once that if I hit a remote object before setting up a messaging channel then the CientID would get screwed up. Try to establish an initial messaging channel once the application loads, and before any remote object calls are made.
Flash Builder's network monitoring tool can cause some problems with BlazeDS. I set up a configuration option on application load that checks to see if I'm in the dev environment (it is called just before setting up my channel from #1). If I'm in dev, I assign a UID manually. For some reason this doesn't take well outside the dev environment... been awhile since I set it all up so I can't remember the finer points as to why:
if (!(AppSettingsModel.getInstance().dev))
FlexClient.getInstance().id = UIDUtil.createUID();
BlazeDS by default only allows for a single HTTP session to be setup per client/browser. In my streaming channel definitions I added the following to allow for additional sessions per browser:
<channel-definition id="my-secure-amf-stream" class="mx.messaging.channels.SecureStreamingAMFChannel">
<endpoint url="https://{server.name}:{server.port}/FlexClient/messagebroker/securestreamingamf"
class="flex.messaging.endpoints.SecureStreamingAMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
<idle-timeout-minutes>0</idle-timeout-minutes>
<max-streaming-clients>10</max-streaming-clients>
<server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis>
<user-agent-settings>
<user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="3" />
<user-agent match-on="Firefox" kickstart-bytes="2048" max-streaming-connections-per-session="3" />
</user-agent-settings>
</properties>
Problem: Duplicate session errors when flex.war and Livecycle.lca files are hosted in separate JVMs on WebSphere Server.
Solution:
Inside the command file for the event, set FlexClientId to null in execute method before calling remote service (Java method or LC Process).
Guess this approach can be used in other scenarios as well to prevent Duplicate session errors.
EventCommand.as file
—————————–
import mx.messaging.FlexClient;
//other imports as per your code
public function execute(event:CairngormEvent):void
{
var evt:EventName = event as EventName ;
var delegate:Delegate = new DelegateImpl(this as IResponder);
//***set client ID to null
FlexClient.getInstance().id = null;
delegate.functionName(evt.data);
}

How to use AIR 2.0 NativeProcess API with Java?

How do you use this great new API in connection with Java? Do you use just pure native process API like nativeProcess.standardInput.write() and nativeProcess.standardOutput.read() with which you cannot debug Java side neither invoke remote java method. Or you are using some library that leverages remote method invocation such as flerry lib but that also cannot debug Java side? Or maybe you are using Merapi with which you can debug but cannot remotely invoke Java method? I'm asking this because this is maybe the most important question regarding this API and its ease of use.
It sounds like your reservations have to do with being able to debug the Java process. This is not really an issue. You can use the NativeProcess API to kick off a Java process with arguments that will cause it to be externally debuggable. For example:
var processArgs:Vector.<String> = new Vector.<String>();
processArgs.push("-Xdebug");
processArgs.push("-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n");
This will allow your Java process to be remote debuggable. You can then connect to it from Eclipse or Netbeans once the process has started. If the code in the Java process is linked to an active Eclipse/Netbeans project, you can do linewise debugging like you would of any other Java application.
-Raj
You can use NativeProcess to execute java.exe and pass it the right parameters to execute a java application.
You cannot use NativeProcess to run random java code from a jar file.
Having used both of them, you can debug the JVM with MerAPI or NativeProcess API.
Prior to AIR2.0, I used merapi to communicate over the network to a java process.
I would much prefer to use the NativeProcess launcher now, with MerAPI we were hacking
ugly marshalling code. Debugging the network payloads was a pin via merapi.
Using NativeProcess API is easy -
var myForkedExe:NativeProcessStartupInfo = new NativeProcessStartupInfo();
myForkedExe.executable = ;
...
I am not sure I understand what you mean by can not invoke remote Java methods with merapi.
That's exactly what I have been doing. Debugging is easy, just set the JPDA args and attach any JAVA debugger.
You could use Flerry to launch and communicate with java processes.
You can use var file:File = new File("/usr/bin/java"); and pass parameters to the Java-file with a Vector of arguments. E.g.
var arguments:Vector.<String> = new Vector.<String>;
arguments.push("-jar");

Resources