Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 240

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Out-of-band Signalling</title>
    <link rel="stylesheet" type="text/css" href="../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Out-of-band Signalling</h1><script>
//We attach this function to a browser object as a variable so that if multiple of these blocks are
//present on the same page, then they will simply over-write eachother with the same function instead
//of generating a naming collision.
window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){
	var sContent = document.getElementById(sID).innerText;
	if( window.clipboardData && clipboardData.setData )
	{
		clipboardData.setData("Text", sContent);
	}
	else
	{
		alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions.");
	}
}
</script>
<p>Sometimes a client needs to send a special message
to a server in order to tell the server to do something. The server
may need to be signalled to perform a defragment or it may need to be
signalled to shut itself down gracefully.</p>
<p>This is configured by calling setMessageRecipient(), passing the object that will process client-initiated messages.</p>

<span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StartServer.cs: <span class="fscMemberName">RunServer</span></span></div><div class="fscCode"><pre ID="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_0_171_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_0_171_Open_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_0_171_Closed_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_0_171_Closed_Text').style.display='inline';"/><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_0_171_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_0_171_Closed_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_0_171_Open_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_0_171_Open_Text').style.display='inline';"/><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_0_171_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">/**/</span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_0_171_Open_Text"><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
</span><span style="color: #008080;">02</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #808080;">///</span><span style="color: #008000;"> opens the IObjectServer, and waits forever until Close() is called
</span><span style="color: #008080;">03</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #808080;">///</span><span style="color: #008000;"> or a StopServer message is being received.
</span><span style="color: #008080;">04</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;"></span></span>
<span style="color: #008080;">05</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #000000;">        </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RunServer()
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_211_1134_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_211_1134_Open_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_211_1134_Closed_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_211_1134_Closed_Text').style.display='inline';"/><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_211_1134_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_211_1134_Closed_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_211_1134_Open_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_211_1134_Open_Text').style.display='inline';"/>        </span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_211_1134_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_211_1134_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">lock</span><span style="color: #000000;">(</span><span style="color: #0000FF;">this</span><span style="color: #000000;">)
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_248_1124_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_248_1124_Open_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_248_1124_Closed_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_248_1124_Closed_Text').style.display='inline';"/><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_248_1124_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_248_1124_Closed_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_248_1124_Open_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_248_1124_Open_Text').style.display='inline';"/>            </span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_248_1124_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_248_1124_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #008000;">//</span><span style="color: #008000;"> Using the messaging functionality to redirect all
</span><span style="color: #008080;">10</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #008000;">//</span><span style="color: #008000;"> messages to this.processMessage</span><span style="color: #008000;">
</span><span style="color: #008080;">11</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                IConfiguration configuration </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.NewConfiguration();
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                configuration.ClientServer().SetMessageRecipient(</span><span style="color: #0000FF;">this</span><span style="color: #000000;">);
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                IObjectServer db4oServer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenServer(configuration, FileName, Port);
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db4oServer.GrantAccess(User, Password);
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_729_949_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_729_949_Open_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_729_949_Closed_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_729_949_Closed_Text').style.display='inline';"/><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_729_949_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_729_949_Closed_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_729_949_Open_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_729_949_Open_Text').style.display='inline';"/>                </span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_729_949_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_729_949_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #000000;"> stop)
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_783_931_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_783_931_Open_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_783_931_Closed_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_783_931_Closed_Text').style.display='inline';"/><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_783_931_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_783_931_Closed_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_783_931_Open_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_783_931_Open_Text').style.display='inline';"/>                    </span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_783_931_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_783_931_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        </span><span style="color: #008000;">//</span><span style="color: #008000;"> wait forever until Close will change stop variable</span><span style="color: #008000;">
</span><span style="color: #008080;">22</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                        Monitor.Wait(</span><span style="color: #0000FF;">this</span><span style="color: #000000;">);   
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>                    }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>                }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception e)
</span><span style="color: #008080;">26</span><span style="color: #000000;"><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_1002_1074_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_1002_1074_Open_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_1002_1074_Closed_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_1002_1074_Closed_Text').style.display='inline';"/><img id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_1002_1074_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_1002_1074_Closed_Text').style.display='none'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_1002_1074_Open_Image').style.display='inline'; document.getElementById('....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_1002_1074_Open_Text').style.display='inline';"/>                </span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_1002_1074_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="....ClientserverCS.ZipsStartServer.Cs_StartServer.Cs_RunServer_418_63_1002_1074_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">27</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(e.ToString());
</span><span style="color: #008080;">28</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>                }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">29</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db4oServer.Close();
</span><span style="color: #008080;">30</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>            }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">31</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>
</span>
<span name="cs_wiki_filter" csw_filters="vb">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">StartServer.vb: <span class="fscMemberName">RunServer</span></span></div><div class="fscCode"><pre ID="....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_0_171_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_0_171_Open_Text').style.display='none'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_0_171_Closed_Image').style.display='inline'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_0_171_Closed_Text').style.display='inline';"/><img id="....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_0_171_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_0_171_Closed_Text').style.display='none'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_0_171_Open_Image').style.display='inline'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_0_171_Open_Text').style.display='inline';"/><span id="....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_0_171_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">/**/</span><span id="....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_0_171_Open_Text"><span style="color: #808080;">'''</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
</span><span style="color: #008080;">02</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #808080;">'''</span><span style="color: #008000;"> opens the IObjectServer, and waits forever until Close() is called
</span><span style="color: #008080;">03</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #808080;">'''</span><span style="color: #008000;"> or a StopServer message is being received.
</span><span style="color: #008080;">04</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #808080;">'''</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;"></span></span>
<span style="color: #008080;">05</span><img id="....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_186_1029_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_186_1029_Open_Text').style.display='none'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_186_1029_Closed_Image').style.display='inline'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_186_1029_Closed_Text').style.display='inline';"/><img id="....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_186_1029_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_186_1029_Closed_Text').style.display='none'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_186_1029_Open_Image').style.display='inline'; document.getElementById('....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_186_1029_Open_Text').style.display='inline';"/><span style="color: #000000;">        </span><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span id="....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_186_1029_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub RunServer()</span><span id="....ClientserverVB.ZipsStartServer.Vb_StartServer.Vb_RunServer_539_63_186_1029_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> RunServer()
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #008000;">'</span><span style="color: #008000;"> Using the messaging functionality to redirect all</span><span style="color: #008000;">
</span><span style="color: #008080;">07</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            </span><span style="color: #008000;">'</span><span style="color: #008000;"> messages to this.processMessage</span><span style="color: #008000;">
</span><span style="color: #008080;">08</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> configuration </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.NewConfiguration()
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            configuration.ClientServer().SetMessageRecipient(</span><span style="color: #0000FF;">Me</span><span style="color: #000000;">)
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">SyncLock</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Me</span><span style="color: #000000;">
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> db4oServer </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectServer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenServer(configuration, File, Port)
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db4oServer.GrantAccess(User, Password)
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Not</span><span style="color: #000000;"> [</span><span style="color: #0000FF;">stop</span><span style="color: #000000;">] </span><span style="color: #0000FF;">Then</span><span style="color: #000000;">
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        </span><span style="color: #008000;">'</span><span style="color: #008000;"> wait forever until Close will change stop variable</span><span style="color: #008000;">
</span><span style="color: #008080;">16</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                        Monitor.Wait(</span><span style="color: #0000FF;">Me</span><span style="color: #000000;">)
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">If</span><span style="color: #000000;">
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Catch</span><span style="color: #000000;"> e </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Exception
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    Console.WriteLine(e.ToString())
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db4oServer.Close()
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">SyncLock</span><span style="color: #000000;">
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>
<p>[/filter] </p>
<p>The message is received and processed by a processMessage() method:</p>
<p> </p>
<p>Db4o
allows a client to send an arbitrary signal or message to a server by
sending a plain user object to the server. The server will receive a
callback message, including the object that came from the client. The
server can interpret this message however it wants.</p>
<p> </p></div>
    </div>
    <div id="footer">
					This revision (4) was last Modified 2007-08-19T13:54:30 by Tetyana.
				</div>
  </body>
</html>