<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:m="http://schemas.microsoft.com/office/2004/12/omml" 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 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.gmailquote
{mso-style-name:gmail_quote;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:424113992;
mso-list-type:hybrid;
mso-list-template-ids:-278472792 201916431 201916441 201916443 201916431 201916441 201916443 201916431 201916441 201916443;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-AU link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Please be careful here.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I’m doing some work with the RealXtend guys to move their custom
code into a set of Region Modules, however I need the SendPacket(Packet x)
function on IClientAPI to do so.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Now admittedly there’s only a few custom packets, and we could
extend IClientAPI to support them – these are:<o:p></o:p></span></p>
<p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span
style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>GenericMessagePacket – Rex has moved to using these to overload
all their messages onto (so that the existing client ignores them safely), we don’t
have a IClientAPI.SendGenericMessage(string[] msg) equivalent yet. This could
be one way we get around this.<o:p></o:p></span></p>
<p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span
style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Convert to SendPacket(Byte[] x), then run
GenericMessagePacket.ToBytes() before passing it to IClientAPI?<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Regards,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Adam<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> opensim-dev-bounces@lists.berlios.de
[mailto:opensim-dev-bounces@lists.berlios.de] <b>On Behalf Of </b>Teravus
Ovares<br>
<b>Sent:</b> Sunday, 17 August 2008 9:44 AM<br>
<b>To:</b> opensim-dev@lists.berlios.de<br>
<b>Subject:</b> Re: [Opensim-dev] Upcoming work on alternative client stack<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<p class=MsoNormal>There are two places that OutPacket needs to be factored out
of the OpenSim core still. In the Texture sender.. (still
uses outpacket!) and ClientManager... There's one packet type
called 'viewereffectpacket'. Refactor those into the client
stack and the below refactorings will be possible.<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal>Best Regards<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal>Teravus<br>
<br>
<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><span class=gmailquote>On 8/14/08, <b>Mike Mazur</b> <<a
href="mailto:mmazur@gmail.com">mmazur@gmail.com</a>> wrote:</span> <o:p></o:p></p>
<p class=MsoNormal>Hello,<br>
<br>
(Could it be? Are the mailing lists working again? I wanted to send<br>
this message last weekend.)<br>
<br>
Some of you may already know, I've started working on an alternative<br>
client stack. This alternative stack does not use libomv's Packet<br>
class to move packets around. The buffers which are written to by<br>
socket functions are passed around instead, with functions available<br>
for extracting or writing data to the buffers.<br>
<br>
These functions are provided by a package currently codenamed
"funsl".<br>
Johan has written a compiler[1] which generates C# and C/C++ code from<br>
LL's message_template.msg file[2].<br>
<br>
We're doing this because we believe the creation of a Packet object<br>
for each transferred packet impacts performance, particularly when GC<br>
events occur.<br>
<br>
As I'm working on this I found that libomv's Packet class is used<br>
outside the client stack, namely in OpenSim/Framework/ClientManager.cs<br>
and OpenSim/Framework/IClientAPI.cs (among other places). Since our<br>
client stack needs to implement these interfaces too, and needs to<br>
call ClientManager methods, those libomv Packet references get in the<br>
way. I would like to factor them out.<br>
<br>
Please allow me to give you an example, inspired by changeset r5785.<br>
ClientManager had a method, InPacket(), defined as below:<br>
<br>
public void InPacket(uint circuitCode, Packet packet)<br>
{<br>
IClientAPI client;<br>
bool tryGetRet = false;<br>
lock (m_clients)<br>
tryGetRet
= m_clients.TryGetValue(circuitCode, out<br>
client); if (tryGetRet)<br>
{<br>
client.InPacket(packet);<br>
}<br>
}<br>
<br>
This method receives a circuit code and passes the packet to the<br>
IClientAPI instance associated with said circuit code.<br>
<br>
Why should the ClientManager have knowledge of Packet? It's not in the<br>
client stack, it only provides access to the clients. Therefore I<br>
changed the method as follows:<br>
<br>
public void InPacket(uint circuitCode, object packet)<br>
{<br>
IClientAPI client;<br>
bool tryGetRet = false;<br>
lock (m_clients)<br>
tryGetRet
= m_clients.TryGetValue(circuitCode, out<br>
client); if (tryGetRet)<br>
{<br>
client.InPacket(packet);<br>
}<br>
}<br>
<br>
Instead of expecting a Packet object for the second argument, we<br>
expect any object. Naturally the signature of the InPacket() method in<br>
the IClientAPI interface has also changed. The cast from object to<br>
Packet (or byte[] in my case) is done in the class which implements<br>
IClientAPI, namely<br>
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs, where InPacket()<br>
has been changed as follows:<br>
<br>
- public virtual void
InPacket(Packet NewPack)<br>
+ public virtual void
InPacket(object NewPack)<br>
{<br>
- m_PacketHandler.InPacket(NewPack);<br>
+ //
Cast NewPack to Packet.<br>
+ m_PacketHandler.InPacket((Packet)
NewPack);<br>
}<br>
<br>
InPacket() is the first method that has been changed so far, but<br>
others will need to follow (OutPacket(), SendSimStats(),<br>
ProcessInPacket(), etc).<br>
<br>
Please rest assured these changes don't break existing functionality,<br>
just factoring out some libomv Packet references which currently live<br>
outside the client stack.<br>
<br>
Any thoughts or concerns?<br>
<br>
Thank you,<br>
Mike<br>
<br>
<br>
[1] If you are interested in the source for the compiler, written in<br>
LISP, just ask ;)<br>
[2]<br>
<a href="http://svn.secondlife.com/trac/linden/browser/release/scripts/messages">http://svn.secondlife.com/trac/linden/browser/release/scripts/messages</a><br>
_______________________________________________<br>
Opensim-dev mailing list<br>
<a href="mailto:Opensim-dev@lists.berlios.de">Opensim-dev@lists.berlios.de</a><br>
<a href="https://lists.berlios.de/mailman/listinfo/opensim-dev">https://lists.berlios.de/mailman/listinfo/opensim-dev</a><o:p></o:p></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</div>
</body>
</html>