Moving micasa 1.5 trunk to Novell forge.

This commit is contained in:
Cameron (Kamran) Mashayekhi
2005-10-11 19:51:00 +00:00
parent 082db33275
commit efe0a5e13c
691 changed files with 116628 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
namespace Novell.CASA
{
/// <summary>
/// Summary description for RemoteServer.
/// </summary>
public class RemoteServer
{
TcpChannel channel;
public RemoteServer()
{
//
// TODO: Add constructor logic here
//
}
public void startServer(int port)
{
int iPort = port;
if (iPort == 0)
iPort = 8080;
channel = new TcpChannel(iPort);
try
{
ChannelServices.RegisterChannel(channel);
}
catch (Exception e)
{
throw e;
}
// Register as an available service with the name HelloWorld
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(SecretStore),
"enumerateSecretIDs",
WellKnownObjectMode.SingleCall );
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(SecretStore),
"getSecret(string id)",
WellKnownObjectMode.SingleCall );
System.Console.WriteLine("Server Started on "+ iPort);
// System.Console.ReadLine();
//return 0;
}
public void stopServer()
{
if (channel != null)
{
System.Console.WriteLine("Stopping server");
ChannelServices.UnregisterChannel(channel);
}
}
}
}