2 // NetPeerTcpBinding.cs
5 // Atsushi Enomoto <atsushi@ximian.com>
6 // Marcos Cobena (marcoscobena@gmail.com)
8 // Copyright (C) 2005 Novell, Inc. http://www.novell.com
9 // Copyright 2007 Marcos Cobena (http://www.youcannoteatbits.org/)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Collections.Generic;
32 using System.Net.Security;
33 using System.ServiceModel.Channels;
34 using System.ServiceModel.Description;
35 using System.ServiceModel.PeerResolvers;
39 namespace System.ServiceModel
41 public class NetPeerTcpBinding : Binding,
42 IBindingDeliveryCapabilities, IBindingMulticastCapabilities,
43 ISecurityCapabilities, IBindingRuntimePreferences
45 string listen_ip_address;
46 long max_buffer_pool_size = 0x80000;
47 long max_recv_message_size = 0x10000;
50 XmlDictionaryReaderQuotas reader_quotas;
51 // PeerResolver resolver = new PeerResolverImpl ();
52 PeerResolverSettings resolver = new PeerResolverSettings ();
53 PeerSecuritySettings security = new PeerSecuritySettings ();
55 public NetPeerTcpBinding ()
60 public NetPeerTcpBinding (string configurationName)
62 throw new NotImplementedException ();
65 public string ListenIPAddress {
66 get { return listen_ip_address; }
67 set { listen_ip_address = value; }
70 public long MaxBufferPoolSize {
71 get { return max_buffer_pool_size; }
72 set { max_buffer_pool_size = value; }
75 public bool MessageAuthentication {
76 get { return msg_auth; }
77 set { msg_auth = value; }
80 public long MaxReceivedMessageSize {
81 get { return max_recv_message_size; }
82 set { max_recv_message_size = value; }
92 public PeerResolverSettings Resolver {
93 get { return resolver; }
94 set { resolver = value; }
97 public XmlDictionaryReaderQuotas ReaderQuotas {
98 get { return reader_quotas; }
99 set { reader_quotas = value; }
102 public override string Scheme {
103 get { return "net.p2p"; }
106 public PeerSecuritySettings Security {
107 get { return security; }
110 public EnvelopeVersion SoapVersion {
111 get { return EnvelopeVersion.Soap12; }
114 public override BindingElementCollection
115 CreateBindingElements ()
117 BinaryMessageEncodingBindingElement mbe =
118 new BinaryMessageEncodingBindingElement ();
119 ReaderQuotas.CopyTo (mbe.ReaderQuotas);
121 PeerTransportBindingElement tbe =
122 new PeerTransportBindingElement ();
123 tbe.ListenIPAddress = ListenIPAddress;
124 tbe.MaxBufferPoolSize = MaxBufferPoolSize;
125 tbe.MaxReceivedMessageSize = MaxReceivedMessageSize;
126 tbe.MessageAuthentication = MessageAuthentication;
128 return new BindingElementCollection (new BindingElement [] { mbe, tbe });
131 // explicit interface implementations
134 bool IBindingDeliveryCapabilities.AssuresOrderedDelivery {
135 get { throw new NotImplementedException (); }
139 bool IBindingDeliveryCapabilities.QueuedDelivery {
140 get { throw new NotImplementedException (); }
144 bool IBindingRuntimePreferences.ReceiveSynchronously {
145 get { throw new NotImplementedException (); }
148 bool IBindingMulticastCapabilities.IsMulticast {
149 get { throw new NotImplementedException (); }
153 ProtectionLevel ISecurityCapabilities.SupportedRequestProtectionLevel {
154 get { throw new NotImplementedException (); }
158 ProtectionLevel ISecurityCapabilities.SupportedResponseProtectionLevel {
159 get { throw new NotImplementedException (); }
163 bool ISecurityCapabilities.SupportsClientAuthentication {
164 get { throw new NotImplementedException (); }
168 bool ISecurityCapabilities.SupportsClientWindowsIdentity {
169 get { throw new NotImplementedException (); }
173 bool ISecurityCapabilities.SupportsServerAuthentication {
174 get { throw new NotImplementedException (); }