# Callbacks Client-Server interaction model

**URL:** <https://community.wowza.com/t/callbacks-client-server-interaction-model/36960>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [July 17, 2011, 5:26pm UTC](https://community.wowza.com/t/callbacks-client-server-interaction-model/36960 "2011-07-17T17:26:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladimir\_Sannikov](https://avatars.discourse-cdn.com/v4/letter/v/ad7895/32.png) [@Vladimir\_Sannikov](https://community.wowza.com/u/Vladimir_Sannikov)\
**Post date:** [July 17, 2011, 5:26pm UTC](https://community.wowza.com/t/callbacks-client-server-interaction-model/36960/1 "2011-07-17T17:26:41Z")

</div>

Hello!

I want to build my application with callback interaction. What is it?

For example, when I work with FMS, I use this code:

Server

```auto
application.onConnect = function(client)
{
application.accetConnection(client);
client.someServerMethod = function(someData)
{
this.call("someClientMethod");
}
}

```

Client

```auto
var nc:NetConnection;
var nClient:Object;
nClient.someClientMethod = function():void
{
trace("some call from Server");
}
nc.client = nClient;
nc.call("someServerMethod",null, someData);

```

When client called someServerMethod, server call someClientMethod. I need to do this scheme in Wowza Server.

_I don`t want to use Responders on client side_

Now I write in my Wowza application next code:

```auto
public void someServerMethod(IClient client, RequestFunction function,
			AMFDataList params) 
	{
		getLogger().info("someServerMethod called");
		
	}

```

And when client call someServerMethod, I see in console: _WARN server comment - Missing function: someServerMethod_

Before in method onConnect i do client.acceptConnection();

And I do not know how to call any method on the client…

Can you talk me about callbacks?

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 17, 2011, 12:53pm UTC](https://community.wowza.com/t/callbacks-client-server-interaction-model/36960/2 "2011-07-17T12:53:14Z")

</div>

Here’s one example:

[https://www.wowza.com/forums/showthread.php?10629-LiveStreamRecord-Module-for-recording-a-live-stream-on-demand/page12#113](https://www.wowza.com/forums/showthread.php?10629-LiveStreamRecord-Module-for-recording-a-live-stream-on-demand/page12#113)

Take a look at the ServerSideModules example that ships with Wowza. There is a Flash client. It is a working reference of Flash \<\> Wowza methods.

There are other examples here:

[https://www.wowza.com/docs/](https://www.wowza.com/docs/)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 17, 2011, 2:47pm UTC](https://community.wowza.com/t/callbacks-client-server-interaction-model/36960/3 "2011-07-17T14:47:24Z")

</div>

If you have an Application module with onAppStart handler you should see the log output when the application starts, not when Wowza starts if that is when you were looking. Run Wowza in stand-alone mode for testing and dev (/bin/startup.bat) so you can see what is happening (stop the service first if it is running). To start the app, play (if vod) or publish (if live app) a stream for it to load and run onAppStart handler.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 17, 2011, 2:51pm UTC](https://community.wowza.com/t/callbacks-client-server-interaction-model/36960/4 "2011-07-17T14:51:10Z")

</div>

Also, at least as I understand the terminology, a function like onAppStart is an event handler. A callback in Wowza/Flash app is a function in one (or the other) that is called by the other, and might return data to the caller. Wowza can call Flash callback functions, and Flash can call Wowza callback functions.

Richard

---

<div class="post-metadata">

**Author:** ![Vladimir\_Sannikov](https://avatars.discourse-cdn.com/v4/letter/v/ad7895/32.png) [@Vladimir\_Sannikov](https://community.wowza.com/u/Vladimir_Sannikov)\
**Post date:** [July 17, 2011, 7:32pm UTC](https://community.wowza.com/t/callbacks-client-server-interaction-model/36960/5 "2011-07-17T19:32:28Z")

</div>

With all respect, this is an incorrect example.

I want to do my system without Responders - only callbacks. Responders not provide asynchrony interaction model. They can realize only call-response model.

In BWChecker example I find sample - client do nc.call without responder, but I can`t repeat it…

Problem - Wowza don`t know about my someServerMethod. And server don`t trace any messages, which writed in methods onConnect, onAppStart and any…

Sample

```auto
	public void onAppStart(IApplicationInstance appInstance) {
		String fullname = appInstance.getApplication().getName() + "/"
				+ appInstance.getName();
		getLogger().info("onAppStart: " + fullname);
	}

```

If I right understand - Wowza IDE must trace in console “onAppStart: HelloWorld”. But no this message and other messages too.

But thank you for second link - must read for me 🙂
