aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/ScriptServer/RemotingServer.cs
blob: 33d8dc884eb0a1f45e3e4de2c214362c4f2b726b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;


namespace OpenSim.Grid.ScriptServer
{
    class RemotingServer
    {

        public void CreateServer(int port, string instanceName)
        {
            // Create an instance of a channel
            TcpChannel channel = new TcpChannel(port);
            ChannelServices.RegisterChannel(channel, true);

            // Register as an available service with the name HelloWorld
            RemotingConfiguration.RegisterWellKnownServiceType(
                typeof(RemotingObject),
                instanceName,
                WellKnownObjectMode.Singleton);

        }
    }
}