I have a requirement to connect to a Wowza server from an HTTPProvider on another server, and pretend to be a Flash client so I can do an ISharedObject.send().
I can’t see any way in the API to do this. Am I missing it, or does that functionality just not exist?
I can do an ISharedObject.send() to locally connected clients, but if there are 2 servers, they may have different client connections.
this should be possible. You would need to get the appInstance you want to work with, then get the sharedobject that appinstance, then you should be able to do the send for that object.
I can have at look at some code but it will not be until later today, if needed.
Shamrock
You can get other VHost like this:
IVHost vhost = VHostSingleton.getInstance("vhostName");
Richard
You can drill down from there:
IVHost vhost = VHostSingleton.getInstance("myVHost");
IApplication app = vhost.getApplication("vod");
IApplicationInstance appInstance = app.getAppInstance("_definst_");
ISharedObject so = appInstance.getSharedObjects().get("mySO");
so.send("clientsideCallback");
Richard
One Wowza server can use HTTPUtils API to load the HTTProvider from another Wowza server. This is all code that can run in a HTTProvider, which is a good way to communicate between Wowza servers, or any application that can load an HTTP url.
This post shows how to parse the querystring in HTTProvider, so you can pass in data. In your what VHost, App name, whatever you need to drill-down where you want to go and take the action you want.
https://www.wowza.com/docs/how-to-parse-post-or-get-variables-in-an-http-provider
Richard
Sending commands using the HTTProvider is good but it would be nice to connect to the shared object directly…I take it this is not possible.
Yes, I think my issue is how to get the IApplicationInstance. I currently get it via :
IApplication app = vhost.getApplication(appName);
IApplicationInstance appInstance = app.getAppInstance(appInstanceName);
Where vhost is passed to my HTTPProvider’s ‘onHTTPRequest’ method. Then I can do:
ISharedObjects sharedObjects = appInstance.getSharedObjects(false);
ISharedObject so = sharedObjects.getOrCreate("aSharedObjectName");
There is apparently no method to get a handle on an IApplication running on another host.
Richard,
The Wowza server defines VHosts, yes, and I can always get a handle on another vHost on the same server. But what I want is to get a handle on an IApplicationInstance on another server. This will be in a different JVM, and will have it’s own VHost.xml.
How can I do that? I’ve looked through the API, but I don’t see any kind of Wowza server connection class, that I can connect to as an IClient.
Imagine that these are 2 different servers (for load balancing reasons, to spread applications, or whatever). I have an HTTPProvider that tracks some server info and does an ISharedObject.send() to some SWF clients that might be using an ISharedObject on the other server. Please ignore security concerns with this for now - this is covered. I just need to know what I should be looking at in the API which will allow me to connect to a server as a conventional flash client would connect. If that’s not possible, that’s also a valid answer - but at the moment, I don’t know if it’s possible or not. I’m an experienced Java developer, but new to Wowza.
Thanks,
Mick
Yes, but this is all on the same server - the same installation of Wowza. My question (again) is how can I call another server?
I’m not a Flash developer, but from my understanding, a Flash client can connect to a server by ip address or some other URI, get a handle on a shared object, and do a SharedObject.send().
I just want to do this from Java, within an HTTPProvider.
I was trying exactly the same thing… in my opinion 3 options:
1.- HTTP -> easiest but not elegant option
2.- WebService -> could be
3.- java RMI -> difficult to implement but really nice
what do you think ?