Hi HoChul,<br><br><div class="gmail_quote">On Tue, May 20, 2008 at 3:14 PM, 유호철 &lt;<a href="mailto:hcyoo@cuwave.co.kr">hcyoo@cuwave.co.kr</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<div style="margin: 5px; font-size: 9pt; font-family: gulim; background-color: rgb(255, 255, 255);">
<p>&nbsp;I want to use [ iguana_client.h ] header function.&nbsp; With my knowing&nbsp;it, first step is established session. </p></div></blockquote><div>You don&#39;t need to establish a session to utilise the services of a server. The first step in communicating with a server is to find out who he is! i.e: you need to discover the server&#39;s thread id. To do this you have 2 options:<br>
<br>1) For an existing server (such as Iguana or Event servers), the easiest way is to utilise the wrapper library provided with the server. These generally perform the server lookup/resolution for you. For example, with the Event server, take a look in libs/event/src/event.c:<br>
<br>static&nbsp; L4_ThreadId_t server_tid;<br>void event_init(void){<br>&nbsp;&nbsp;&nbsp; thread_ref_t server_;<br>&nbsp;&nbsp;&nbsp; memsection_lookup((objref_t) env_memsection_base(iguana_getenv(&quot;OKL4_EVENT_SERVER&quot;)),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;server_);<br>
&nbsp;&nbsp;&nbsp; server_tid = thread_l4tid(server_);<br>}<br><br>What it&#39;s doing is discovering the TID of the server from an Iguana environment variable which corresponds to the name of the server. This name is defined in the SConscript for the server. For example, in iguana/event/SConscript:<br>
<br>weaver = env.WeaverIguanaProgramServer(server_name = &quot;OKL4_EVENT_SERVER&quot;, priority=200)<br><br>2)&nbsp; You can include &lt;interfaces/{server}_client.h&gt; directly, in which case you need to perform the lookup yourself in the same manner as above.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="margin: 5px; font-size: 9pt; font-family: gulim; background-color: rgb(255, 255, 255);">
<p>But,&nbsp;&nbsp;IGUANA_GETENV_IGUANA_SERVER of setup_ig_lib() section&nbsp;is not exist. Is a way different from a&nbsp;case of iguana_session&nbsp;and&nbsp;&nbsp;[my_test_esrver] session?</p></div></blockquote></div><div>Iguana is special - it is the root server and resource manager for your applications. ElfWeaver doesn&#39;t populate an environment variable with the Iguana server - to
utilise its services, you should use the Iguana library (libs/iguana).
For example, to have Iguana create a memsection for you, #include
&lt;iguana/memsection.h&gt;.<br><br>Under the hood, the Iguana library is performing the lookup for you, but since it doesn&#39;t have the environment variable to use it needs to do it another way. For this it uses the fact that Iguana server is your pager - it simply uses the L4_Pager() call to find the server.<br>
<br>Hope this aids in your understanding.<br><br>Best regards,<br>Josh Matthews<br>
</div>