wsky / top-link

embedded duplex multi-channel endpoint and connection management for c#/java/...
6 stars 1 forks source link

impl formattersink that c# can using .net remoting call to java directly #56

Closed wsky closed 11 years ago

wsky commented 11 years ago

base remoting protocol is same as .net remoting,

https://github.com/wsky/RemotingProtocolParser

https://github.com/wsky/RemotingProtocolParser/blob/master/csharp/RemotingProtocolParserTest/Remoting.cs#L47

public class JsonServerFormatterSinkProvider : IServerFormatterSinkProvider
    {
        public IServerChannelSink CreateSink(IChannelReceiver channel)
        {
            if (this.Next != null)
            {
                var nextChannelSink = Next.CreateSink(channel);
                if (nextChannelSink != null)
                    return new JsonServerFormatterSink(nextChannelSink);
            }
            return null;
        }
        public void GetChannelData(IChannelDataStore channelData) { }
        public IServerChannelSinkProvider Next { get; set; }
    }
wsky commented 11 years ago

15