none
WCF Peer Channel Help RRS feed

  • Question

  • I am architecting a program that I need some help on.  I need to have a "watcher" program that will sit on a server and monitor a SQL Server.  At configured intervals, the watcher will run a query on the server and create a dataset of information I want to share to any clients that are listening.  I am looking at WCF Peer channel but all I can see is peer to peer chat and most of the examples I have seen are partial examples.  I have looked at the example program from Microsoft but I am still a bit confused.  The listener programs will receive the dataset of values from the watcher and filter the data at the local level and display the data they need and display it to the end user.  I don't know if a TCP client/server would be a better solution, but the dataset may contain up to 10,000 rows of data.  From what I read the WCF Peer channel will transmit at 50 mbps and should handle this load.  

    My other option is a server/client architecture using TCP spawning a new thread for each request.  Does anyone have any good examples, or articles about WCF Peer Channel and VB that they can point me to?  I can do c# as well, but I really need a good shove in the right direction moving datasets around.

    Thanks.

    Monday, March 12, 2012 1:06 PM

Answers

  • Hello, WCF doesn't support multicast out of box. So you have to implement your own. If you just want a simulation, there're a few options:

    1. Like rupex pointed out, let the client poll the service at a regular interval. The obvious disadvantage is performance may not be good.

    2. Use a duplex channel. NetTcpBinding supports duplex communication, which means the client will have a TCP listener, and the server can push messages to clients when it wants to. This approach usually gives you better performance, but not every platform supports it. If all clients are Windows PCs that support WCF, though, it should work fine. Refer to http://msdn.microsoft.com/en-us/library/ms731064.aspx for more information.

    3. Throw away WCF, use UDP multicast directly.

    4. Write a custom transport statck for WCF that supports multicast. The UDP transport sample may help. But it may also turn out to be more work compared to use UDP directly without WCF.

    As for P2P, I'm not sure if it supports multicast or not.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.

    Tuesday, March 13, 2012 1:58 AM

All replies

  • I have thought of doing it that way, however, the toll on the server will increase as each client comes on line.  Each client can have 1 to X tags they want to monitor and I suspect that as this little watcher comes on line a lot of engineers will want to see this data for all the tags they can (Engineers are notorious for wanting more data then they need).  Also, I want to push the filtering and processing of the data to the client to off load it from the server, so I though if I broadcast the tags to the clients at a regular interval, they could listen for the broadcast, filter and process locally and the watcher would only have to send the dataset out at a regular interval.  I did toy around with having the watcher provide a custom dataset per user, but again, this may tax the server more than we want.  If anyone else has another suggestion, I am open to any other suggestions.

    Thanks

    Monday, March 12, 2012 1:28 PM
  • Hello, WCF doesn't support multicast out of box. So you have to implement your own. If you just want a simulation, there're a few options:

    1. Like rupex pointed out, let the client poll the service at a regular interval. The obvious disadvantage is performance may not be good.

    2. Use a duplex channel. NetTcpBinding supports duplex communication, which means the client will have a TCP listener, and the server can push messages to clients when it wants to. This approach usually gives you better performance, but not every platform supports it. If all clients are Windows PCs that support WCF, though, it should work fine. Refer to http://msdn.microsoft.com/en-us/library/ms731064.aspx for more information.

    3. Throw away WCF, use UDP multicast directly.

    4. Write a custom transport statck for WCF that supports multicast. The UDP transport sample may help. But it may also turn out to be more work compared to use UDP directly without WCF.

    As for P2P, I'm not sure if it supports multicast or not.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.

    Tuesday, March 13, 2012 1:58 AM