Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Peer 2 Peer conection in Silverlight RSS

15 replies

Last post Mar 24, 2011 06:56 PM by Magikos

(0)
  • Montago

    Montago

    Member

    292 Points

    241 Posts

    Peer 2 Peer conection in Silverlight

    Oct 03, 2008 02:28 PM | LINK

    Im thinking about how to connect 2 SL apps in P2P mode..

     

    What happens if an open Silverlight socket, recieves data from an IP different to its connected policy Socket ?

    ( I think its called bootstrapping ) 

     

    I would connect 2 apps to a policy server, then request an Image from the open IP:PORT on the other machine - would it work ?

     

    has anyone succeeded (note that i have browsed a little on this forum, and google... havent found anything useful )

    Thanks 

    Microsoft Silverlight Partner (since 2010)
    Microsoft Gold Partner
  • HarshBardhan

    HarshBardhan

    Star

    10118 Points

    1749 Posts

    Re: Peer 2 Peer conection in Silverlight

    Oct 03, 2008 03:06 PM | LINK

    Hi,

    If you want to get Images and Media Files You can get that Directly Over Http....

     But For other kind of data your thought looks interesting..

    Mark as answer if this post answered your question.

    Harsh Bardhan
  • SpoonStomper

    SpoonStomper

    Member

    114 Points

    38 Posts

    Re: Peer 2 Peer conection in Silverlight

    Oct 03, 2008 05:59 PM | LINK

    I don't believe Silverlight 2 allows cross-domain socket calls removing the possibility of Silverlight client to client communication. However you could probably fake it through a server utilizing the push/pull mechanisms of WCF. For file access you would have to install another application to host communications on the IP:Port since silverlight clients don't have implicit access to the file system unless the images were stored in IsolatedStorage.

  • Yi-Lun Luo - MSFT

    Yi-Lun Luo -...

    All-Star

    25149 Points

    2759 Posts

    Microsoft

    Re: Peer 2 Peer conection in Silverlight

    Oct 06, 2008 11:46 AM | LINK

    Hello, we support cross domain socket communication as long as the policy file is ready. But P2P is completely different. It doesn't require a server. All communications are from client to client. On the other hand, socket uses a client/server architecture. You can't get P2P behavior with Silverlight unless you rquire every client has a valid socket policy file and a socket server, which is unlikely to be the situation. Also, if you can deploy a socket server on each client, why not create a desktop P2P solution directly?

    shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.
  • Magikos

    Magikos

    Member

    529 Points

    220 Posts

    Re: Re: Peer 2 Peer conection in Silverlight

    Oct 06, 2008 07:51 PM | LINK

    Is it possible to have two silverlight applications talk to each other?  For example in a game or IM type application?

    Maybe have a server that the silverlight client connects to, then when two people want to play or chat the server sends down the IP address and the silverlight can make the connection, each one accepts a policy file request, replies and then connects?

  • Yi-Lun Luo - MSFT

    Yi-Lun Luo -...

    All-Star

    25149 Points

    2759 Posts

    Microsoft

    Re: Re: Re: Peer 2 Peer conection in Silverlight

    Oct 07, 2008 10:22 AM | LINK

    Unfortunately today you can't do that without a server. If you have a server, you can either use WCF Duplex Service (much easier to build but less effiecient if you need to exchange binary data), or Socket (requires a lot of code, but can be very efficient since binary data doesn't need to be translated to xml).

    shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.
  • Magikos

    Magikos

    Member

    529 Points

    220 Posts

    Re: Re: Re: Re: Peer 2 Peer conection in Silverlight

    Oct 07, 2008 03:09 PM | LINK

    Yeah, that's what I thought.  Any idea if that will ever change?

  • coolio

    coolio

    Member

    421 Points

    120 Posts

    Re: Peer 2 Peer connection in Silverlight

    Oct 07, 2008 06:05 PM | LINK

    You can do it without a server (at least if you are willing to host your application in Windows Live Messenger). 

    You may want to look into small P2P Silverlight library I've written and posted on codeplex a while ago. It uses the Live Messenger Activity API for real-time P2P traffic between two Silverlight applications. Available at http://www.codeplex.com/SilverlightP2P

    No more secrets with Silverlight Spy. Now with support for OOB and WP7
  • bcheung

    bcheung

    Member

    2 Points

    1 Post

    Re: Peer 2 Peer connection in Silverlight

    Oct 22, 2008 09:30 AM | LINK

     Hi,

    I've looked into your silverlight library, and indeed it looks very impressive. However, I wonder if it is able to support streaming video data (300kbps), and would it require a computer with Windows Live Messenger (or some other kind of server) installed to act as a server?

  • coolio

    coolio

    Member

    421 Points

    120 Posts

    Re: Peer 2 Peer connection in Silverlight

    Oct 22, 2008 10:47 AM | LINK

    The P2PLib requires two Live Messenger instances. As far as I know, the Live Messenger Activity API does not expose any streaming features but you should be able to send raw bytes back and forth between the Live Messenger instances.

    For now the P2PLib only allows for sending and receiving string data, but with some modification I assume sending bytes should be possible as well.

    No more secrets with Silverlight Spy. Now with support for OOB and WP7