Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 96 lines (78 sloc) 2.274 kb
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
// -*- mode: csharp; c-basic-offset: 2; indent-tabs-mode: nil -*-
//
// IceChannel.cs
//
// Written by:
// Vladimir Vukicevic <vladimir@sparklestudios.com>
//
// Copyright (C) 2003 Sparkle Studios, LLC
//
// This file is distributed under the terms of the license
// agreement contained in the LICENSE file in the top level
// of this distribution.
//
 

using System;
using System.IO;
using System.Collections;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Proxies;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Channels;

namespace Ice {

  public class IceChannel
    : IChannelReceiver, IChannelSender, IChannel
  {
    IceServerChannel _svrChannel;
    IceClientChannel _cltChannel;

    string name = "ice";

    public IceChannel()
      : this(0)
    {
    }

    public IceChannel(int port) {
      Ice.TcpEndpoint te = new Ice.TcpEndpoint ("localhost", port);
      te.Incoming = true;
      _svrChannel = new IceServerChannel (te);
      _cltChannel = new IceClientChannel ();
    }

    public IceChannel (IDictionary props,
                       IClientChannelSinkProvider clientSinkProvider,
                       IServerChannelSinkProvider serverSinkProvider)
    {
      throw new NotImplementedException();
    }

    public object ChannelData {
      get {
        return _svrChannel.ChannelData;
      }
    }

    public string ChannelName {
      get {
        return name;
      }
    }

    public int ChannelPriority {
      get {
        return _svrChannel.ChannelPriority;
      }
    }

    public IMessageSink CreateMessageSink (string url,
                                           object remoteChannelData,
                                           out string objectUri)
    {
      return _cltChannel.CreateMessageSink (url, remoteChannelData, out objectUri);
    }

    public string[] GetUrlsForUri (string objectUri) {
      return _svrChannel.GetUrlsForUri (objectUri);
    }

    public string Parse (string url, out string objectUri) {
      return _svrChannel.Parse (url, out objectUri);
    }

    public void StartListening (object data) {
      _svrChannel.StartListening (data);
    }

    public void StopListening (object data) {
      _svrChannel.StopListening (data);
    }
  }

}
Something went wrong with that request. Please try again.