Peer to Peer Presentation from Code Camp Available

10/27/2009 9:01:01 AM

For those of you that want the Code Camp presentation, you can get it here.  The code can be downloaded here.

Tags:

Peer2Peer

Update to the Azure Storage App

10/20/2009 4:03:07 PM

Just a quick update to the Azure Storage app… added support for both Win 7 folder dialogs and older Windows as well.  Still not perfect by any stretch of the imagination, but slightly better. I would like to try and add drag and drop support and provide a progress indicator for larger files when uploading. 

Download Here

Tags:

Azure

Spaghetti Code Podcast with Adam Grocholski

10/19/2009 10:54:00 AM

Spaghetti Code talks with Adam Grocholski  about the Text Template Transformation Toolkit, or T4.  Adam walks us through what T4 is, how it works, and how you can use it in your own software projects.

 

  • Direct Download - click here
  • Subscribe - click here
  • iTunes - click here
  • Tags:

    SpaghettiCode

    Quick Azure Storage Application

    10/12/2009 11:00:42 AM

    I had need to demo some Azure blob storage stuff to a customer the other day.  This is what I churned out.  Quick and dirty, incomplete testing, and probably some design flaws, but it gets the point across. ;-)

    To use the sample, you need to modify the DemoAuthorizationService.cs file to include your real Azure account and token information, or change it to use the local devstore account and key (though you  will need to modify the DemoAuthToken.cs file to return the right Uri – like I said, some stuff that needed to be cleaned up).

    Oh, and I did some wonky stuff with the WPF interface as well as far as styling some buttons go – better way to do what I did – but I was learning styling as I went and just banged out something that worked.  Having said all that, not a bad example of MVVM/MVP/whatever you want to call it.

    Download here

    Tags:

    Azure

    Peer to Peer Series Part 5: Connecting Peers via WCF

    10/8/2009 11:48:00 AM

    In Part 5 of the Peer to Peer Series, I show a sample application that uses PNRP to connect a client application to a server application using WCF and PNRP Peer Host Names. The details of the actual WCF Service implementation.  Instead, I will focus on those areas of leveraging PNRP to establish connections via WCF.

    The video will show a sample application that is comprised of a client and a server application.  You could use a more “peer-to-peer” duplex-style of communication, but the client-server arrangement makes the two key parts of establishing a WCF connection easier to explain.

    When hosting a WCF service, the key code from the IntelServiceHost.cs file is shown below:

     

    this.PeerRegistration.Start(peerClassifier, port);
    Uri tcpUri = new Uri(string.Format("net.tcp://{0}:{1}/IntelService", this.PeerRegistration.PeerUri, port));
    _serviceHost = new ServiceHost(service, tcpUri);
    NetTcpBinding tcpBinding = new NetTcpBinding(SecurityMode.None);
    _serviceHost.AddServiceEndpoint(typeof(IIntelService), tcpBinding, "");
     

    The PeerRegistration property exposes a wrapper class around the PNRP API.  The Start method registers the application with a given peer classifier and port as an unsecure peer name in the Global PNRP Cloud.  The PeerUri property passes back the peerhostname.  That uri is used to setup a new Uri, along with the port, that is then used to configure the ServiceHost using a NetTcpBinding.  Some of this could have been configured in the application’s config file, but I put it all here so you can see how the different parts relate.

    The client side of the equation is even easier (found in the IntelClient.cs file):

    PeerNameResult peerRecord = PeerResolution.ResolveHostName(hostPeerName);
     
    System.ServiceModel.Channels.Binding netBinding = new NetTcpBinding(SecurityMode.None);
    EndpointAddress endpointAddress = new EndpointAddress(string.Format("net.tcp://{0}:{1}/IntelService", peerRecord.Uri, peerRecord.Port));
     
    IntelServiceProxy = new IntelProxy(netBinding, endpointAddress);

    The PeerResolution class is another wrapper around the PNRP API, this time providing resolving a given unsecure peer name in the Global PNRP cloud.  It returns an object containing the remote peer’s peerhostname and port. The rest of the code is just setting up the client side of the WCF connection.

    Other documentation for PNRP:

    View the Screencast:

    Download the Demo Code

    Tags:

    Peer2Peer

    Special Edition Spaghetti Code Podcast on the PHP Bridge

    10/7/2009 8:18:00 AM

    Spaghetti Code teams up with the Thirsty Developerpodcast to conduct a special edition, joint interview of Claudio Caldato, Senior Program Manager for Microsoft’s Interoperability Team.  Thirsty Developer Host Dave Bost and I talk to Claudio about his team, what they do, and more specifically about the recently released PHP Bridge to ADO.NET Data Services. 

    You can get more information on the PHP Bridge from these locations:

  • Direct Download - click here
  • Subscribe - click here
  • iTunes - click here
  • Tags:

    SpaghettiCode

    Making Windows Friendly for .NET Developers

    10/6/2009 10:44:37 AM

    I know… it does seem odd that I would have a title of saying that Windows needs to be friendly to .NET developers.  Considering that .NET is THE development environment for Windows (no offense to my C++ or Mono friends), it seems a strange that I would have some “complaints” about Windows not being friendly towards .NET developers.  But it’s true.

    It is not that Windows isn’t a good platform to develop on. Quite the contrary.  Great tools, lots of great OS features that are readily accessible, etc.  The problem is that the Windows team sometimes forgets that the vast majority of Windows development is now done in .NET.  I am sure many of you read that and said, “Duh! Of course.”  So what am I talking about?

    As you start getting into the back corners of the operating system, it suddenly feels like some Microsoft teams have never heard of .NET.  Example?  Windows Firewall.  I have been writing some peer-to-peer stuff and it would be nice to be able to set some firewall rules when an app is installed, or better yet, prompt the user at runtime to change the rules and dynamically set them.  Can you do that?  Sure, if you are writing in C++ or want to use a COM object and wrap it with .NET.  There is no .NET implementation out of the box.  Talk about a pain in the ass!  I have spent enough time playing with p/invoke and COM wrappers to know that I don’t want to go there unless absolutely necessary.

    Peer to peer is another example.  Great team – good guys on it.  They have been fantastic helping me work my way through my learning.   The problem is, some of the coolest parts of their stack do not have a managed implementation.  Distributed routing tables? Absolutely wicked stuff but C++ only.  Peer Groups; C++ only. Peer Graphs; C++ only.  Double argghhh!

    Even with the release of Windows 7, the problem continues.  The Windows API Code Pack certainly helped expose some of the new Win 7 features, but still no Windows Firewall support.  Peer to peer still missing.  Some other APIs are still native only.  Considering that .NET has been around for quite a while now, you would think that 100% of the Windows API would be covered with managed implementations by now.

    Some day, my friends, some day….

    Tags:

    Rant

    Powered by BlogEngine.NET 1.6.0.0
    Theme by Mads Kristensen

    About the author

    Jeff Brand Jeff Brand

    This is the personal web site of Jeff Brand, self-proclaimed .NET Sex Symbol and All-Around Good guy. Content from my presentations, blog, and links to other useful .NET information can all be found here.

    E-mail me Send mail


    Calendar

    <<  August 2014  >>
    MoTuWeThFrSaSu
    28293031123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    View posts in large calendar

    My Twitter Updates

    XBOX
    Live

    Recent comments

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2014

    Sign in