# cupertino streaming : Client object in onHTTPCupertinoStreamingSessionCreate is null

**URL:** <https://community.wowza.com/t/cupertino-streaming-client-object-in-onhttpcupertinostreamingsessioncreate-is-null/35868>\
**Category:** Wowza Streaming Engine\
**Created:** [April 13, 2011, 1:06pm UTC](https://community.wowza.com/t/cupertino-streaming-client-object-in-onhttpcupertinostreamingsessioncreate-is-null/35868 "2011-04-13T13:06:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaushik\_kunal](https://avatars.discourse-cdn.com/v4/letter/k/898d66/32.png) [@kaushik\_kunal](https://community.wowza.com/u/kaushik_kunal)\
**Post date:** [April 13, 2011, 1:06pm UTC](https://community.wowza.com/t/cupertino-streaming-client-object-in-onhttpcupertinostreamingsessioncreate-is-null/35868/1 "2011-04-13T13:06:00Z")

</div>

Hi,

I need to set the property of the client object from onHTTPCupertinoStreamingSessionCreate event eg :

```auto
httpCupertinoStreamingSession.getStream().getclient().getProperties().setProperty("info",hashMapData);

```

and later on access the same data from implementation of IMediaStreamFileMapper class like.

```auto
         IClient client= stream.getClient();
    	 mfmb=(Map)client.getProperties().getProperty("info");

```

But its giving me error nullpointer exception on the onHTTPCupertinoStreamingSessionCreate method where i am setting the object.

I tried setting the value of property in httpstreamersession object’s property rather then client for example -:

```auto
httpCupertinoStreamingSession.getStream().getHTTPStreamerSession().getProperties().setProperty("info",hashMapData);

```

and later accessing the same data from implementation of IMediaStreamFileMapper like

```auto
String cacheObject=(String)(stream.getHTTPStreamerSession().getProperties().getProperty("info"));

```

But this also seems to fail.

Can you suggest some way of setting the property value and accessing it later.?

---

<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:** [April 13, 2011, 10:59pm UTC](https://community.wowza.com/t/cupertino-streaming-client-object-in-onhttpcupertinostreamingsessioncreate-is-null/35868/2 "2011-04-13T22:59:14Z")

</div>

IClient is the server-side of Flash NetConnection, so client will always be null in HTTP or RTP session.

You should be able to use the stream. Try this:

```auto
httpCupertinoStreamingSession.getStream().getProperties().setProperty("info",hashMapData);

```

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:** [April 14, 2011, 12:40am UTC](https://community.wowza.com/t/cupertino-streaming-client-object-in-onhttpcupertinostreamingsessioncreate-is-null/35868/3 "2011-04-14T00:40:57Z")

</div>

Another approach is use a Map and use sessionID as a key.

Richard

---

<div class="post-metadata">

**Author:** ![Chi-Hsing\_Chu](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Chi-Hsing\_Chu](https://community.wowza.com/u/Chi-Hsing_Chu)\
**Post date:** [April 14, 2011, 10:52am UTC](https://community.wowza.com/t/cupertino-streaming-client-object-in-onhttpcupertinostreamingsessioncreate-is-null/35868/4 "2011-04-14T10:52:54Z")

</div>

Hi kkaushik

Try this:

set properties

HTTPStreamerSessionCupertino.getProperties().setProperty(MyConsts.USER\_DATA, “MyString”);

get properties

HTTPStreamerSessionCupertino.getProperties().getPropertyStr(MyConsts.USER\_DATA);

James

---

<div class="post-metadata">

**Author:** ![kaushik\_kunal](https://avatars.discourse-cdn.com/v4/letter/k/898d66/32.png) [@kaushik\_kunal](https://community.wowza.com/u/kaushik_kunal)\
**Post date:** [April 13, 2011, 3:54pm UTC](https://community.wowza.com/t/cupertino-streaming-client-object-in-onhttpcupertinostreamingsessioncreate-is-null/35868/5 "2011-04-13T15:54:04Z")

</div>

Hi Richard,

I am tryied using it. Although i am not getting any error, but the value which is set here is not retained till we reach implementation of IMediaStreamFileMapper.

here the value of the set property “info” is returned as null.

Does it mean to retain the value thoughout session?

---

<div class="post-metadata">

**Author:** ![kaushik\_kunal](https://avatars.discourse-cdn.com/v4/letter/k/898d66/32.png) [@kaushik\_kunal](https://community.wowza.com/u/kaushik_kunal)\
**Post date:** [April 14, 2011, 8:21am UTC](https://community.wowza.com/t/cupertino-streaming-client-object-in-onhttpcupertinostreamingsessioncreate-is-null/35868/6 "2011-04-14T08:21:54Z")

</div>

Hi James

Thanks for your reply.

Although i can set the property as you described but there is no object “HTTPStreamerSessionCupertino” in my implementation of IMediaStreamFileMapper class. So i am not able to extract whatever i have set.

Thanks,

Kunal
