aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/ScriptServer/RemotingServer.cs
blob: 3ec3e64b2e1f0dc1c4c2c40d631487ea13aa5d08 (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);

        }
    }
}