windows communication foundation indigo a deep dive into extending the channel layer n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Windows Communication Foundation (“Indigo”): A Deep Dive Into Extending The Channel Layer PowerPoint Presentation
Download Presentation
Windows Communication Foundation (“Indigo”): A Deep Dive Into Extending The Channel Layer

Loading in 2 Seconds...

play fullscreen
1 / 24

Windows Communication Foundation (“Indigo”): A Deep Dive Into Extending The Channel Layer - PowerPoint PPT Presentation


  • 126 Views
  • Uploaded on

Windows Communication Foundation (“Indigo”): A Deep Dive Into Extending The Channel Layer . Kenny Wolf, Software Development Engineer Yasser Shohoud, Lead Program Manager COM424 Microsoft Corporation. What’s in it for you?. Enable new transports (e.g. SMTP, UDP)

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Windows Communication Foundation (“Indigo”): A Deep Dive Into Extending The Channel Layer' - butch


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
windows communication foundation indigo a deep dive into extending the channel layer

Windows Communication Foundation (“Indigo”): A Deep Dive Into Extending The Channel Layer

Kenny Wolf, Software Development Engineer

Yasser Shohoud, Lead Program Manager

COM424

Microsoft Corporation

what s in it for you
What’s in it for you?
  • Enable new transports (e.g. SMTP, UDP)
  • Integrate with other systems (e.g. Java RMI)
  • Implement custom infrastructure protocols

Channel extensibility is an opportunity for component vendors

endpoints and channels
Endpoints and Channels

ServiceHost host = new ServiceHost(typeof(MyService));

Uri address = new Uri(“net.tcp://kennyw2/Service/endpoint”);

Binding binding = new NetTcpBinding();

Type contract = typeof(IMyContract);

host.AddEndpoint(address, binding, contract);

host.Open();

channel types

Proxy

Dispatcher

Protocol Channel(s)

Transport Channel

Protocol Channel(s)

Transport Channel

Channel Types
layered extensibility

Proxy

Dispatcher

Protocol Channel(s)

Transport Channel

Protocol Channel(s)

Transport Channel

Layered Extensibility

Service Model Extensibility

(local only)

Channel Extensibility

(affects the wire)

outline
Outline
  • Writing a TCP transport
  • Writing a chunking protocol channel
  • Wrap up and Q&A
channel shapes

IOutputChannel

IInputChannel

IRequestChannel

IReplyChannel

IDuplexChannel

IDuplexChannel

Channel Shapes
sockets vs channels client

Client

Service

Sockets vs. Channels (Client)

Channel

Socket

CreateChannel(Uri);

channel.Open()

new Socket();

socket.Connect(IP, port)

channel.Send(Message)

socket.Send(byte[])

Throws CommunicationException

or TimeoutException

Throws SocketException

socket.Close()

channel.Close()

Exception contract

Unit of Data Transferred

Shutdown

Addressing

<Envelope><Body>...</Envelope>

my.tcp://kennyw2:808/myService/

{0x08, 0xAF, 0x6D, 0xBE, 0xEF, ...}

(172.30.16.60, 808)

unit of data transfer message bytes
Unit of Data TransferMessage  Bytes
  • MessageEncoder
    • Text, Binary, and MTOM ship with “Indigo”
  • BufferManager
    • Proper tuning can yield large (>10%) performance increases

ArraySegment<byte> WriteMessage(Message, maxSize, BufferManager)

Message ReadMessage(ArraySegment<byte>, BufferManager)

void WriteMessage(Message message, Stream stream)

Message ReadMessage(Stream stream, int maxSizeOfHeaders)

BufferManager.CreateBufferManager(long maxBufferPoolSize,int maxSize)

unit of data transfer framing message bytes
Unit of Data TransferFraming Message Bytes
  • Need to encapsulate certain information outside of the SOAP message
    • Byte Length of Data
    • Content Type & Uri for Channel
  • Method: 4 byte size, then data

19

text/xml

my.tcp://kennyw2/a/

386

8

channel.Open()

CreateChannel(“my.tcp://kennyw2/a/”)

channel.Send(message)

sockets vs channels service

Client

Service

Sockets vs. Channels (Service)

Channel

Socket

new Socket();

listenSocket.Bind(IP, port);

listenSocket.Listen();

BuildChannelListener<T>(Uri);

listener.Open();

IChannel = listener.AcceptChannel();

Socket = listenSocket.Accept()

socket.Receive(byte[])

Message = channel.Receive()

socket.Close()

channel.Close()

Unit of Data Transferred

Shutdown

Accept

Addressing

outline1
Outline
  • Writing a TCP transport
  • Writing a chunking protocol channel
  • Wrap up and Q&A
managing inner channel state
Managing Inner Channel State

Open

  • Open inner channel
  • Wait for pending sends, if any
  • Drain session, if applicable
  • Close inner channel

Close

Abort

  • Abort inner channel
handling inner channel events
Handling Inner Channel Events

Opened

Opening

Useful for reacting to state transitions when your code is not driving the channel

Closing

Closed

Faulted

When inner channel faults, your channel should recover or fault

message
Message
  • Message is the unit of I/O in Indigo
    • Based on XML InfoSet
    • Consists of headers and body
  • Message Headers
    • Buffered, random access collection
    • Used to implement infrastructure protocols
  • Message Body
    • Forward-only cursor
    • Used to carry application data
working with message
Working With Message
  • Reading body content
  • Creating messages using BodyWriter
  • Reading and writing headers
  • Creating messages using XmlDictionaryReader
  • Custom messages
configuring channels binding element configuration

App Code

WS-Policy

Configuring ChannelsBinding Element Configuration

ChunkingBindingElement

Properties

Chunking Configuration Section

Policy Import

.config

configuring channels custom behaviors

Custom Behavior

BindingParameters

BindingElement

ChannelFactory

ChannelListener

Configuring ChannelsCustom Behaviors
key take aways
Key Take Aways
  • Write custom channels when you need to
    • Change what goes on the wire
    • Integrate with arbitrary systems
    • Enable new transports
  • Channel extensibility is an opportunity for component vendors

Please fill out the evaluation

We want to know what you think!

community resources
Community Resources
  • At PDC
    • COM429: A Deep Dive into Extending the Service Model Layer (Fri 10:30am)
    • COM413: IIS and Windows Communication Foundation (“Indigo”): Hosting Services (Fri 1pm)
    • Labs: COMHOL29
    • Ask The Experts table: ExtendingWCF
    • COM Track lounge: We’ll be there Thu 5-6pm, Fri 8:30-noon
  • After PDC
    • If you missed this related session, watch it on the DVD
      • COM424: WCF: A Deep Dive into Extending the Channel Layer
    • MSDN dev center: http://msdn.microsoft.com/webservices/
    • MSDN Forum: Windows Communication Foundation ("Indigo")
    • http://www.kennyw.com/indigo/
    • http://blogs.msdn.com/yassers/
    • Channel 9 tag: http://channel9.msdn.com/tags/Indigo/
slide24

© 2005 Microsoft Corporation. All rights reserved.

This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.