<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - CSecureSocket resource leak (CONE 36) - Comments</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36</link>
 <description>Comments for &quot;CSecureSocket resource leak (CONE 36)&quot;</description>
 <language>en</language>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-49336</link>
 <description>&lt;p&gt; TInetAddr address;&lt;br /&gt;
TRequestStatus iStatus;&lt;br /&gt;
RHostResolver resolver;&lt;br /&gt;
TNameEntry entry;&lt;/p&gt;

&lt;p&gt;User::LeaveIfError(resolver.Open(iSocketServ, KAfInet, KProtocolInetTcp));&lt;br /&gt;
CleanupClosePushL( resolver );&lt;br /&gt;
resolver.GetByName(_L(&quot;192.168.2.24&quot;), entry);&lt;/p&gt;

&lt;p&gt;CleanupStack::PopAndDestroy();//for resolver&lt;/p&gt;

&lt;p&gt;address.SetAddress((TInetAddr::Cast(entry().iAddr)).Address());&lt;br /&gt;
address.SetPort(2801);&lt;br /&gt;
User::LeaveIfError(clientSockId.Open(iSocketServ, KAfInet, KSockStream, KProtocolInetTcp));&lt;/p&gt;

&lt;p&gt;clientSockId.Connect(address, iStatus);&lt;br /&gt;
User::WaitForRequest(iStatus);&lt;br /&gt;
if(iStatus == KErrNone)&lt;br /&gt;
{&lt;br /&gt;
_LIT(KTLS1,&quot;TLS1.0&quot;);&lt;br /&gt;
iTlsSocket = CSecureSocket::NewL(clientSockId,KTLS1);&lt;br /&gt;
iTlsSocket-&gt;FlushSessionCache();&lt;br /&gt;
iTlsSocket-&gt;StartClientHandshake(iStatus);&lt;br /&gt;
User::WaitForRequest(iStatus);&lt;br /&gt;
User::LeaveIfError(iStatus.Int());&lt;br /&gt;
if(iStatus == KErrNone)&lt;br /&gt;
readDatastrt(); //read welcome after handshake&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;its hangs out after StartClientHandshake&lt;/p&gt;</description>
 <pubDate>Thu, 06 Nov 2008 09:28:52 +0100</pubDate>
 <dc:creator>udayasri</dc:creator>
 <guid isPermaLink="false">comment 49336 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-47501</link>
 <description>&lt;p&gt;i have resolved the issue now. I make sure that all the resources i used are closed appropriately.&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;//For example in case of RHostResolver&lt;br /&gt;iResolver.Cancel();&lt;br /&gt;iResolver.Stop();&lt;br /&gt;//even though stop() is enough.&lt;br /&gt;&lt;br /&gt;//like wise for socket:&lt;br /&gt;iSoket.CancellAll();&lt;br /&gt;iTlsSocket-&amp;gt;CancelAll();&lt;br /&gt;iTlsSocket.Close();&lt;br /&gt;delete iTlsSocket();&lt;br /&gt;iTlsSocket = 0;&lt;br /&gt;iSocket.Close();&lt;br /&gt;//Finally SocketServ&lt;br /&gt;iSocketServ.Close();&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;</description>
 <pubDate>Mon, 14 Jul 2008 15:17:29 +0200</pubDate>
 <dc:creator>gmsk19</dc:creator>
 <guid isPermaLink="false">comment 47501 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-47502</link>
 <description>&lt;p&gt;But i have also noticed with my earlier code in N95 that this does CONE 36 did not happen. now N95 panics if there anything wrong . it only happened in the emulator&lt;/p&gt;</description>
 <pubDate>Mon, 14 Jul 2008 15:16:31 +0200</pubDate>
 <dc:creator>gmsk19</dc:creator>
 <guid isPermaLink="false">comment 47502 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-47256</link>
 <description>&lt;p&gt;gmsk19: &lt;br /&gt;
No...  You have not &quot;resolved&quot; it...  you have hidden the error.&lt;br /&gt;
You still have the programmatic error in your application, you just choose to ignore it now...&lt;br /&gt;
Ofcourse, its possible it won&#039;t cause any problems (depending a bit on the exact cause of it) but you have not fixed it, its still there, with all that could mean.&lt;br /&gt;
Just wanted to make that clear &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;/p&gt;</description>
 <pubDate>Tue, 01 Jul 2008 10:33:22 +0200</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 47256 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-47247</link>
 <description>&lt;p&gt;I have Resolved the CONE 36 Errors by using this in the ConstructL() of my AppUi&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;iCoeEnv-&amp;gt;DisableExitChecks(ETrue);&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;This CONE 36 Panic happens only in emulator , In the Device all the Resouce handles get closed upon calling Close/stop etc&lt;/p&gt;</description>
 <pubDate>Tue, 01 Jul 2008 07:04:28 +0200</pubDate>
 <dc:creator>gmsk19</dc:creator>
 <guid isPermaLink="false">comment 47247 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-47086</link>
 <description>&lt;p&gt;My only other suggestion would be to try calling Stop() on your connection rather than Close() then. The documentation for Close() does state it doesn&#039;t disconnect the socket immediately, although it should close your connection to it. Stop will immediately shut down the connection without careing about it &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And yeah, check out what they say over at Symbian.&lt;/p&gt;</description>
 <pubDate>Tue, 17 Jun 2008 18:41:14 +0200</pubDate>
 <dc:creator>workmad3</dc:creator>
 <guid isPermaLink="false">comment 47086 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-47085</link>
 <description>&lt;p&gt;keep it up &lt;br /&gt;
 &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;  &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;  &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;  &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;  &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;  &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;  &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;  &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;  &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt; &lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Tue, 17 Jun 2008 17:44:31 +0200</pubDate>
 <dc:creator>praveen.nitdgp@gmail.com</dc:creator>
 <guid isPermaLink="false">comment 47085 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-47084</link>
 <description>&lt;p&gt;Cheers for the responses guys.&lt;/p&gt;

&lt;p&gt;I have checked that the code doesn&#039;t leave (before posting).&lt;br /&gt;
I do Close() all the R classes.&lt;br /&gt;
The code above is intended to be readable, rather than best practice. The actual code I am working with is a big state machine.&lt;/p&gt;

&lt;p&gt;I guess the next step is to head to the symbian forums and see what happens there.&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Tue, 17 Jun 2008 17:40:20 +0200</pubDate>
 <dc:creator>TomCooper</dc:creator>
 <guid isPermaLink="false">comment 47084 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-47083</link>
 <description>&lt;p&gt;That code isn&#039;t leave-safe. If any of those opens and connects fail, it will leave the connection open. You should be using&lt;br /&gt;
CleanupClosePushL()&lt;br /&gt;
and the like to put your open resources onto the cleanup stack so that they are destroyed if the code leaves at any point.&lt;br /&gt;
The same is true with your CSecureSocket creation, although that can be put on the cleanup stack normally.&lt;/p&gt;

&lt;p&gt;Of course, that doesn&#039;t help if the code isn&#039;t leaving &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt; Have you stepped through the code in the emulator to see if it is causing an error at any point and doing so? If not, I&#039;d suggest doing so and checking if the code leaves anywhere.&lt;/p&gt;</description>
 <pubDate>Tue, 17 Jun 2008 17:24:35 +0200</pubDate>
 <dc:creator>workmad3</dc:creator>
 <guid isPermaLink="false">comment 47083 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-47082</link>
 <description>&lt;p&gt;Ehm.. I think he obviously knows that very well &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;br /&gt;
If you try read the post too, and look at what he is asking, and what he tries in the code...&lt;/p&gt;

&lt;p&gt;To me, it sounds like something you need to take up with symbian directly, try ask on their forums on developer.symbian.com&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Tue, 17 Jun 2008 15:00:15 +0200</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 47082 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comment-47079</link>
 <description>&lt;p&gt;hi&lt;br /&gt;
&lt;span style=&quot;font-weight:bold&quot;&gt;CONE 36&lt;/span&gt; is Open handles were found during application shutdown&lt;br /&gt;
This happens if a call to &lt;span style=&quot;font-weight:bold&quot;&gt;RThread::HandleCount(TInt &amp; aProcessHandleCount, TInt &amp; aThreadHandleCount) const ;&lt;/span&gt;  returns anything other than zero on application exit.&lt;br /&gt;
Things which have a handle are generally things that you Open() and Close() and usually are R classes. Check through your code that all Open()&#039;s are matched with a Close().&lt;/p&gt;

&lt;p&gt;Possibles are RThread, RHeap, RArray (doesn&#039;t need an Open(), but does need a Close() or Reset) etc.&lt;br /&gt;
for more news on Symbian Visit regularly &lt;a href=&quot;http://symbianeasy.blogspot.com/&quot;&gt;http://symbianeasy.blogspot.com/&lt;/a&gt;&lt;/p&gt;</description>
 <pubDate>Tue, 17 Jun 2008 13:57:01 +0200</pubDate>
 <dc:creator>praveen.nitdgp@gmail.com</dc:creator>
 <guid isPermaLink="false">comment 47079 at http://www.newlc.com</guid>
</item>
<item>
 <title>CSecureSocket resource leak (CONE 36)</title>
 <link>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36</link>
 <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I&#039;m trying to resolve a resource leak with CSecureSocket which I can reproduce on both UIQ and Series60 emulators. I&#039;ve seen previous posts on this topic but without any resolution.&lt;/p&gt;

&lt;p&gt;Generally, the following example code will connect to a secure server and shut down cleanly. On one particular server (yahoo&#039;s pop3 server) I get a resource leak.  &lt;img src=&quot;/sites/all/modules/smileys/packs/example/puzzled.png&quot; title=&quot;Puzzled&quot; alt=&quot;Puzzled&quot; /&gt; &lt;/p&gt;

&lt;p&gt;Can anyone shead any light on this?&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/forum/csecuresocket-resource-leak-cone-36#comments</comments>
 <category domain="http://www.newlc.com/en/forums/communications">Communication and Networking</category>
 <pubDate>Tue, 17 Jun 2008 12:36:14 +0200</pubDate>
 <dc:creator>TomCooper</dc:creator>
 <guid isPermaLink="false">21236 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
