<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
I know that part of why the Close() thing is so tangly is because we need to make sure certain packets have been sent before just killing the connection, and that some of them might need to wait for a response from the client. So it's a difference between Close() as in Dispose() and Close() as in 'shut down user connection correctly' afaicanrecall.<BR>
<BR>
Also, I think part of the confusion is a somewhat fuzzy diversion of responsibility between the client itself and the client manager.<BR>
<BR>
Ideally, all core code outside the manager and its clients should ask the Client Manager to close a Client correctly (as it should know how to remove references to clients, but also to interact with other system management resources) - the emptying of queues and actual closing down should probably be a private matter for the client class.<BR>
<BR>
The Client Thus probably would need to have a 'shutting down' flag, throwing non-essential packets, and it would signal to the client manager when it's done with its internal closing down work, so the manager can remove the references from the system. I believe that can be the origin of the event vs dispose bool. Which is ugly as hell, and I'm probably the one to introduce it.<BR> <BR>Best regards,<BR>Stefan Andersson<BR>Tribal Media AB<BR><BR><BR><BR> <BR>
<HR id=stopSpelling>
From: adam@deepthink.com.au<BR>To: opensim-dev@lists.berlios.de<BR>Date: Sun, 22 Feb 2009 02:21:05 -0500<BR>Subject: [Opensim-dev] Refactoring IClientAPI.Close and Friends<BR><BR>
<STYLE>
.ExternalClass p.EC_MsoNormal, .ExternalClass li.EC_MsoNormal, .ExternalClass div.EC_MsoNormal
{margin-bottom:.0001pt;font-size:11.0pt;font-family:'Calibri','sans-serif';}
.ExternalClass a:link, .ExternalClass span.EC_MsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.EC_MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p.EC_MsoListParagraph, .ExternalClass li.EC_MsoListParagraph, .ExternalClass div.EC_MsoListParagraph
{margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;font-size:11.0pt;font-family:'Calibri','sans-serif';}
.ExternalClass span.EC_EmailStyle17
{font-family:'Calibri','sans-serif';color:windowtext;}
.ExternalClass .EC_MsoChpDefault
{;}
@page Section1
{size:612.0pt 792.0pt;}
.ExternalClass div.EC_Section1
{page:Section1;}
.ExternalClass ol
{margin-bottom:0cm;}
.ExternalClass ul
{margin-bottom:0cm;}
</STYLE>
<DIV class=EC_Section1>
<P class=EC_MsoNormal>Right now, we have four separate close methods for clients, enumerated they are (for LLClientView):</P>
<P class=EC_MsoNormal> </P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN>Close(bool circuit)</P>
<P class=EC_MsoListParagraph style="MARGIN-LEFT: 72pt; TEXT-INDENT: -18pt"><SPAN style="FONT-FAMILY: 'Courier New'"><SPAN>o<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN></SPAN>Either fires an event, or closes the connection depending on parameter[!?]</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN>Kick(string msg)</P>
<P class=EC_MsoListParagraph style="MARGIN-LEFT: 72pt; TEXT-INDENT: -18pt"><SPAN style="FONT-FAMILY: 'Courier New'"><SPAN>o<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN></SPAN>Asks the client politely to quit. [!?]</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN>Stop()</P>
<P class=EC_MsoListParagraph style="MARGIN-LEFT: 72pt; TEXT-INDENT: -18pt"><SPAN style="FONT-FAMILY: 'Courier New'"><SPAN>o<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN></SPAN>Initialises some shutdown cleanup</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN>Restart()</P>
<P class=EC_MsoListParagraph style="MARGIN-LEFT: 72pt; TEXT-INDENT: -18pt"><SPAN style="FONT-FAMILY: 'Courier New'"><SPAN>o<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN></SPAN>Undo-‘s the above</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN>Terminate()</P>
<P class=EC_MsoListParagraph style="MARGIN-LEFT: 72pt; TEXT-INDENT: -18pt"><SPAN style="FONT-FAMILY: 'Courier New'"><SPAN>o<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN></SPAN>Stops processing packets for the user and removes their entry in the packet server</P>
<P class=EC_MsoNormal> </P>
<P class=EC_MsoNormal>I would like to propose changing this into three methods.</P>
<P class=EC_MsoNormal> </P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN>Close(string msg) – Combines Kick, Terminate and Close into one method. We need to find out why Close branches onto the event when the parameter is true, or closes when false, and streamline it. Kick should automatically terminate the connection – there should be no ‘requests’ involved, it should be a very straight forward ‘You are the weakest link. Goodbye.’</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN>Pause() – Equivilent to Stop() as it is now. Function described as ‘Suspend Packet Processing’</P>
<P class=EC_MsoListParagraph style="TEXT-INDENT: -18pt"><SPAN>-<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></SPAN>Resume() – Equivilent to Restart() as it is now. Function described as ‘Resume Packet Processing’</P>
<P class=EC_MsoNormal> </P>
<P class=EC_MsoNormal>Adam</P></DIV></body>
</html>