Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. EndpointAddress address = new EndpointAddress("net.tcp://localhost:9000/SomeService");
  2. var netTcpBinding = new NetTcpBinding();
  3.  
  4. var channelFactory = new ChannelFactory<IService>(netTcpBinding, address);
  5.  
  6. IService channel = channelFactory.CreateChannel();
  7.  
  8. Parallel.For(0, 10, new ParallelOptions{MaxDegreeOfParallelism = 10}, i =>
  9. {
  10. try
  11. {
  12. channel.SomeOperation();
  13. }
  14. catch
  15. {
  16.  
  17. }
  18. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement