⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class_c_chat_bt.html

📁 一个聊天的软件
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="l00471"></a>00471     <span class="comment">// Authentication, Encryption, Authorisation and Denied</span><a name="l00472"></a>00472     <span class="comment">// Method also return the channel available to listen to. </span><a name="l00473"></a>00473     TInt channel;<a name="l00474"></a>00474     <a class="code" href="class_c_chat_bt.html#0820a88dbf60867ff8bd16608ca82127">SetSecurityWithChannelL</a>( EFalse, EFalse, ETrue, EFalse, channel );<a name="l00475"></a>00475 <a name="l00476"></a>00476     <a class="code" href="class_c_chat_bt.html#c6e4669be42b0ffcebccf64b06d29163">iAdvertiser</a>-&gt;<a class="code" href="class_c_chat_bt_service_advertiser.html#9093b04fd818259d860c2018923de28d">StartAdvertisingL</a>( channel );<a name="l00477"></a>00477     <a class="code" href="class_c_chat_bt.html#c6e4669be42b0ffcebccf64b06d29163">iAdvertiser</a>-&gt;<a class="code" href="class_c_chat_bt_service_advertiser.html#29ff2152d04f8af97601d4a42d6ec6c0">UpdateAvailabilityL</a>( ETrue );<a name="l00478"></a>00478     <a name="l00479"></a>00479     <a class="code" href="class_c_chat_base.html#3632b5e9a01d31118bbf932b3cd23f34">SetServer</a>( ETrue );<a name="l00480"></a>00480 <a name="l00481"></a>00481     }</pre></div><p>    </td>  </tr></table><a class="anchor" name="b1104e8857d8028d35407cd7fa38c8df"></a><!-- doxytag: member="CChatBt::StopL" ref="b1104e8857d8028d35407cd7fa38c8df" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void CChatBt::StopL           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p><a class="el" href="class_c_chat_bt.html#b1104e8857d8028d35407cd7fa38c8df">StopL()</a> Stop server. <p>Definition at line <a class="el" href="_chat_bt_8cpp-source.html#l00565">565</a> of file <a class="el" href="_chat_bt_8cpp-source.html">ChatBt.cpp</a>.<p>References <a class="el" href="_chat_bt_8h-source.html#l00231">iAcceptedSocket</a>, <a class="el" href="_chat_bt_8h-source.html#l00243">iActiveSocket</a>, <a class="el" href="_chat_bt_8h-source.html#l00225">iAdvertiser</a>, <a class="el" href="_chat_bt_service_advertiser_8cpp-source.html#l00160">CChatBtServiceAdvertiser::IsAdvertising()</a>, <a class="el" href="_chat_bt_8h-source.html#l00207">iSocket</a>, <a class="el" href="_chat_base_8cpp-source.html#l00140">CChatBase::State()</a>, and <a class="el" href="_chat_bt_service_advertiser_8cpp-source.html#l00146">CChatBtServiceAdvertiser::StopAdvertisingL()</a>.<p>Referenced by <a class="el" href="_chat_appui_8cpp-source.html#l00201">CChatAppUi::HandleCommandL()</a>, and <a class="el" href="_chat_bt_8cpp-source.html#l00123">RunL()</a>.<div class="fragment"><pre class="fragment"><a name="l00566"></a>00566     {<a name="l00567"></a>00567     <span class="keywordflow">if</span> ( <a class="code" href="class_c_chat_base.html#af77e92297a4bac4704e440284577ebe">State</a>() != EDisconnected )<a name="l00568"></a>00568         {<a name="l00569"></a>00569         <span class="keywordflow">if</span> ( <a class="code" href="class_c_chat_bt.html#c6e4669be42b0ffcebccf64b06d29163">iAdvertiser</a>-&gt;<a class="code" href="class_c_chat_bt_service_advertiser.html#8b6ebb2e28d11dbf0c365fe8d479df10">IsAdvertising</a>() )<a name="l00570"></a>00570             {<a name="l00571"></a>00571             <a class="code" href="class_c_chat_bt.html#c6e4669be42b0ffcebccf64b06d29163">iAdvertiser</a>-&gt;<a class="code" href="class_c_chat_bt_service_advertiser.html#e66d57ea0fe5dcabfa4673a7b6adc47b">StopAdvertisingL</a>();<a name="l00572"></a>00572             }<a name="l00573"></a>00573         <span class="comment">// Close() will wait forever for Read to complete</span><a name="l00574"></a>00574         <span class="keywordflow">if</span> ( <a class="code" href="class_c_chat_base.html#af77e92297a4bac4704e440284577ebe">State</a>() == EConnected )<a name="l00575"></a>00575             {<a name="l00576"></a>00576             <span class="keywordflow">if</span> ( <a class="code" href="class_c_chat_bt.html#42435def2f80909f7700ad684c625f0f">iActiveSocket</a> )<a name="l00577"></a>00577                 {<a name="l00578"></a>00578                 iActiveSocket-&gt;CancelRead();<a name="l00579"></a>00579                 }<a name="l00580"></a>00580             }    <a name="l00581"></a>00581         <a class="code" href="class_c_chat_bt.html#43d47cb0a780f4af02110487231ac627">iAcceptedSocket</a>.Close();<a name="l00582"></a>00582         <a class="code" href="class_c_chat_bt.html#4791a9b2a2447d2068a89acb05c8c25b">iSocket</a>.Close();<a name="l00583"></a>00583         }<a name="l00584"></a>00584         <a class="code" href="class_c_chat_base.html#deacd9f98d0548748cf116698aea2be0">SetState</a>( EWaitingToGetDevice );<a name="l00585"></a>00585     }</pre></div><p>    </td>  </tr></table><a class="anchor" name="79737b00f2b6a07492c7caf4220c6691"></a><!-- doxytag: member="CChatBt::DoCancel" ref="79737b00f2b6a07492c7caf4220c6691" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void CChatBt::DoCancel           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p><a class="el" href="class_c_chat_bt.html#79737b00f2b6a07492c7caf4220c6691">DoCancel()</a> Cancel any outstanding requests <p>Reimplemented from <a class="el" href="class_c_chat_base.html#79737b00f2b6a07492c7caf4220c6691">CChatBase</a>.<p>Definition at line <a class="el" href="_chat_bt_8cpp-source.html#l00113">113</a> of file <a class="el" href="_chat_bt_8cpp-source.html">ChatBt.cpp</a>.<div class="fragment"><pre class="fragment"><a name="l00114"></a>00114     {<a name="l00115"></a>00115     <span class="comment">// no implementation required</span><a name="l00116"></a>00116     }</pre></div><p>    </td>  </tr></table><a class="anchor" name="98dcd20e4dd117488a6a90dadd4dfac5"></a><!-- doxytag: member="CChatBt::RunL" ref="98dcd20e4dd117488a6a90dadd4dfac5" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top">void CChatBt::RunL           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p><a class="el" href="class_c_chat_bt.html#98dcd20e4dd117488a6a90dadd4dfac5">RunL()</a> Respond to an event <p>Reimplemented from <a class="el" href="class_c_chat_base.html#98dcd20e4dd117488a6a90dadd4dfac5">CChatBase</a>.<p>Definition at line <a class="el" href="_chat_bt_8cpp-source.html#l00123">123</a> of file <a class="el" href="_chat_bt_8cpp-source.html">ChatBt.cpp</a>.<p>References <a class="el" href="_chat_bt_8cpp-source.html#l00377">ConnectToServerL()</a>, <a class="el" href="_chat_bt_8cpp-source.html#l00358">DisconnectFromServerL()</a>, <a class="el" href="_chat_bt_service_searcher_8cpp-source.html#l00083">CChatBtServiceSearcher::FindServiceL()</a>, <a class="el" href="_chat_bt_8h-source.html#l00225">iAdvertiser</a>, <a class="el" href="_chat_bt_8h-source.html#l00219">iBuffer</a>, <a class="el" href="_chat_bt_8h-source.html#l00189">iLog</a>, <a class="el" href="_chat_bt_8h-source.html#l00183">iServiceSearcher</a>, <a class="el" href="_chat_bt_8h-source.html#l00207">iSocket</a>, <a class="el" href="class_m_log.html#70fb5098d98a8b349c056b46102d5de9">MLog::LogL()</a>, <a class="el" href="_chat_bt_8cpp-source.html#l00592">RequestData()</a>, <a class="el" href="_chat_bt_service_searcher_8cpp-source.html#l00299">CChatBtServiceSearcher::ResponseParams()</a>, <a class="el" href="_chat_base_8cpp-source.html#l00130">CChatBase::SetState()</a>, <a class="el" href="_chat_base_8cpp-source.html#l00140">CChatBase::State()</a>, <a class="el" href="_chat_bt_8cpp-source.html#l00565">StopL()</a>, and <a class="el" href="_chat_bt_service_advertiser_8cpp-source.html#l00118">CChatBtServiceAdvertiser::UpdateAvailabilityL()</a>.<div class="fragment"><pre class="fragment"><a name="l00124"></a>00124     {<a name="l00125"></a>00125 <a name="l00126"></a>00126     HBufC* textResource = NULL;<a name="l00127"></a>00127     TBuf&lt;KMaxMarkLen&gt; mark;<a name="l00128"></a>00128   <a name="l00129"></a>00129     <span class="keywordflow">if</span> ( iStatus == KErrDisconnected )<a name="l00130"></a>00130         {<a name="l00131"></a>00131         <span class="comment">// Disconnected</span><a name="l00132"></a>00132         HBufC* strDisconnected = StringLoader<a name="l00133"></a>00133             ::LoadLC ( R_CHAT_STR_DISCONNECTED );<a name="l00134"></a>00134         <a class="code" href="class_c_chat_bt.html#9d387bbae93f2ae894f3e1c32e6bf1c6">iLog</a>.<a class="code" href="class_m_log.html#70fb5098d98a8b349c056b46102d5de9">LogL</a>( *strDisconnected );<a name="l00135"></a>00135         CleanupStack::PopAndDestroy( strDisconnected );<a name="l00136"></a>00136         <a class="code" href="class_c_chat_bt.html#b1104e8857d8028d35407cd7fa38c8df">StopL</a>();<a name="l00137"></a>00137         <span class="keywordflow">return</span>;<a name="l00138"></a>00138         }<a name="l00139"></a>00139         <a name="l00140"></a>00140     <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( iStatus == KErrAbort )<a name="l00141"></a>00141         {<a name="l00142"></a>00142         HBufC* strDisconnected = StringLoader<a name="l00143"></a>00143             ::LoadLC ( R_CHAT_STR_DISCONNECTED );<a name="l00144"></a>00144         <a class="code" href="class_c_chat_bt.html#9d387bbae93f2ae894f3e1c32e6bf1c6">iLog</a>.<a class="code" href="class_m_log.html#70fb5098d98a8b349c056b46102d5de9">LogL</a>( *strDisconnected );<a name="l00145"></a>00145         CleanupStack::PopAndDestroy( strDisconnected );<a name="l00146"></a>00146         <a class="code" href="class_c_chat_bt.html#b1104e8857d8028d35407cd7fa38c8df">StopL</a>();<a name="l00147"></a>00147         <span class="keywordflow">return</span>;<a name="l00148"></a>00148         }<a name="l00149"></a>00149   <a name="l00150"></a>00150     <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( iStatus != KErrNone )<a name="l00151"></a>00151         {<a name="l00152"></a>00152         <span class="keywordflow">switch</span> ( <a class="code" href="class_c_chat_base.html#af77e92297a4bac4704e440284577ebe">State</a>() )<a name="l00153"></a>00153             {<a name="l00154"></a>00154             <span class="keywordflow">case</span> EGettingDevice:<a name="l00155"></a>00155                 <span class="keywordflow">if</span> ( iStatus == KErrCancel )<a name="l00156"></a>00156                     {<a name="l00157"></a>00157                     textResource = StringLoader<a name="l00158"></a>00158                         ::LoadLC( R_CHAT_ERR_NO_DEVICE_SELECTED );<a name="l00159"></a>00159                     <a class="code" href="class_c_chat_bt.html#9d387bbae93f2ae894f3e1c32e6bf1c6">iLog</a>.<a class="code" href="class_m_log.html#70fb5098d98a8b349c056b46102d5de9">LogL</a>( *textResource );<a name="l00160"></a>00160                     CleanupStack::PopAndDestroy( textResource );<a name="l00161"></a>00161                     }<a name="l00162"></a>00162                 <a class="code" href="class_c_chat_base.html#deacd9f98d0548748cf116698aea2be0">SetState</a>( EWaitingToGetDevice );<a name="l00163"></a>00163                 <span class="keywordflow">break</span>;<a name="l00164"></a>00164                 <a name="l00165"></a>00165             <span class="keywordflow">case</span> EGettingService:<a name="l00166"></a>00166             

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -