![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Creation of Multple net.p2p Client Is it possible to programmatically create two net.p2p clients for the SAME mesh within the SAME process? It seems System.ServiceModel.Channels.PeerNodeImplementation.Registration.CheckIfCompatible(PeerNodeImplementation peerNode, Uri via) checks to ensure the Resolver instances between bindings are the same (among other things); if they are not then it throws an error. The unfortunate side effect is that all of my net.p2p node instances within a single process have the same NetPeerTcpBinding.Port number <snippet> // // Create the instance context. // InstanceContext instanceContext = new InstanceContext(this); // // Create the contract. // ContractDescription contract = ContractDescription.GetContract(typeof(IXRingDhtMulticastMembership)); // // Create a peer binding with a custom resolver, which is required // since the current operating system is the Windows 2003 Server family. // NetPeerTcpBinding binding = new NetPeerTcpBinding(); binding.Port = _node.PeerEndpointAddress.Uri.Port; // the port number is different for each P2P client binding.Security.Mode = SecurityMode.None; binding.Name = _node.ToString(); // // If the default PNPR service is not available then fall back to our custom // peer resolver. // if (!NetPeerTcpBinding.IsPnrpAvailable) { binding.Resolver.Custom.Address = new EndpointAddress("net.tcp://localhost/p2p/PeerResolverService"); binding.Resolver.Custom.Binding = new NetTcpBinding(SecurityMode.None, true); // // If I change this value of the Resolver property to be that of a static member (same for all instances) then everything works. // It seems System.ServiceModel.Channels.PeerNodeImplementation.Registration.CheckIfCompatible(PeerNodeImplementation peerNode, Uri via) // checks to ensure the Resolver instances between bindings are the same; if they are not then it throws an error. // binding.Resolver.Custom.Resolver = new CustomerPeerResolver(); binding.Resolver.Mode = PeerResolverMode.Custom; } // // Create the address. // ServiceEndpoint serviceEndpoint = new ServiceEndpoint(contract, binding, _node.PeerEndpointAddress); serviceEndpoint.Name = _node.ToString(); // // Create the participant with the given endpoint configuration // Each participant opens a duplex channel to the mesh participant is an instance of the // chat application that has opened a channel to the mesh // _netPeerTcpChannelFactory = new DuplexChannelFactory<IXRingDhtMulticastMembershipChannel(instanceContext , serviceEndpoint); _netPeerTcpChannel = _netPeerTcpChannelFactory.CreateChannel(); // ERROR: This line throws the attached error after the first iteration (for nodes 2 and greater). </snippet> Any insight is appreciated. Thanks, Michael |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multple desktops | fastjetflyer | General Discussion | 5 | 6 Days Ago 04:07 AM |
| PDF Creation? | niagara94 | Vista General | 5 | 05-28-2008 10:54 AM |
| XML Document creation | ebgreen | PowerShell | 3 | 11-05-2007 06:19 PM |
| multple email accounts | John Malia | Vista mail | 2 | 08-22-2007 08:03 PM |
| Problems running multple sound devices | blackgold9 | Vista music pictures video | 0 | 07-03-2006 10:05 AM |