<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Consolas;
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Consolas;
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=blue face=Consolas><span
style='font-size:10.0pt;font-family:Consolas;color:blue'>I&#8217;ve got some
more detail on the issue and a solution:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Consolas><span
style='font-size:10.0pt;font-family:Consolas;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><st1:PersonName w:st="on"><font size=2 color=blue
 face=Consolas><span style='font-size:10.0pt;font-family:Consolas;color:blue'>Vortex</span></font></st1:PersonName><font
size=2 color=blue face=Consolas><span style='font-size:10.0pt;font-family:Consolas;
color:blue'> obviously knows the connection has died because the memory for the
<st1:PersonName w:st="on">Vortex</st1:PersonName>Connection object has been
freed when I call vortex_connection_is_ok() with it. So, how about adding a
check for the validity of the memory block that the <st1:PersonName w:st="on">Vortex</st1:PersonName>Connection
object is using within vortex_connection_is_ok()?&nbsp; Or, add a new API
function that checks the objects validity. Something like vortex_connection_is_object_valid()
or vortex_connection_is_memory_valid()?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Consolas><span
style='font-size:10.0pt;font-family:Consolas;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Consolas><span
style='font-size:10.0pt;font-family:Consolas;color:blue'>For checking the
validity I would suggest adding a magic number to each instance of an object
when constructed and resetting it to 0 when destructing it. To check the
object, compare the object instances magic number to the actual magic number.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Consolas><span
style='font-size:10.0pt;font-family:Consolas;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Consolas><span
style='font-size:10.0pt;font-family:Consolas;color:blue'>Another surefire check,
at least under Windows, is to call _msize() with the pointer to the <st1:PersonName
w:st="on">Vortex</st1:PersonName>Connection object and check that the returned
size is consistent with a valid <st1:PersonName w:st="on">Vortex</st1:PersonName>Connection
object.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Consolas><span
style='font-size:10.0pt;font-family:Consolas;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Consolas><span
style='font-size:10.0pt;font-family:Consolas;color:blue'>Chris<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Consolas><span
style='font-size:10.0pt;font-family:Consolas;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
vortex-bounces@lists.aspl.es [mailto:vortex-bounces@lists.aspl.es] <b><span
style='font-weight:bold'>On Behalf Of </span></b><st1:PersonName w:st="on">Chris
 Yourch</st1:PersonName><br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, May 21, 2008 3:50
PM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">Vortex</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> [<st1:PersonName w:st="on">Vortex</st1:PersonName>]
vortex_connection_is_ok() bug?</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Consolas><span style='font-size:10.0pt;
font-family:Consolas'>I have a situation where 2 peers are connected, exchange
some messages and then one of the peers goes down. When the still running peer
attempts another connection with the peer it tries to reuse the <st1:PersonName
w:st="on">Vortex</st1:PersonName>Connection object. But, before I reuse the <st1:PersonName
w:st="on">Vortex</st1:PersonName>Connection object I pass it to
vortex_connection_is_ok() and it returns true. Shouldn&#8217;t
vortex_connection_is_ok() return false?&nbsp; Or, is there another way to
ensure that a <st1:PersonName w:st="on">Vortex</st1:PersonName>Connection
object is really valid? <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Consolas><span style='font-size:10.0pt;
font-family:Consolas'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Consolas><span style='font-size:10.0pt;
font-family:Consolas'>Chris<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Consolas><span style='font-size:10.0pt;
font-family:Consolas'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>