Using sockets

Greetings,

What are your thoughts on communication from the WPF/E platform in the long run - I understand web service calls will be possible, but do you also plan on allowing WEF/E clients to open up a socket to it's originating server (such as the XmlSocket in Flash)? If so - when?

Thanks!

/Billy

[324 byte] By [BillyPorter] at [2008-3-1]
# 1

There was a discussion of this subject here and the result was:

In the CTP, JavaScript (AJAX) is used as the programming layer of 'WPF/E" and anything you can do with JavaScript is valid. To communicate you will probably need to have the server to act as a proxy between the clients unless the client have web server capability. In the future we plan to introduce a managed code engine you can use in parallel to Javascript and we are investigating what should be provided in our communication stack. Now is the time to ask for specific scenarios.

So if you have a specific scenario then I would post more about it. There already is a way to open an XmlSocket so to speak by using the downloader object which can download xml or images. If you have a requirement that this doesn't meet then let the team know.

BryantLikes at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 2
Bryant Likes wrote:

There was a discussion of this subject here and the result was:

In the CTP, JavaScript (AJAX) is used as the programming layer of 'WPF/E" and anything you can do with JavaScript is valid. To communicate you will probably need to have the server to act as a proxy between the clients unless the client have web server capability. In the future we plan to introduce a managed code engine you can use in parallel to Javascript and we are investigating what should be provided in our communication stack. Now is the time to ask for specific scenarios.

So if you have a specific scenario then I would post more about it. There already is a way to open an XmlSocket so to speak by using the downloader object which can download xml or images. If you have a requirement that this doesn't meet then let the team know.

Thank you for you answer,

When I talk about using sockets from a WPF/E app, I'm not talking about just downloading files, I'm talking about using the System.Net.Socket to open up a persistent connection to the server from which the app was loaded and handling send and recieve events just as you would from any normal C# app. My question is: will this be possible? And if so, any ideas when?

I'm aware that you can do just about anything with the current CTP by combining it with Ajax, but quite frankly - that's not the way I want to work.

Thanks

BillyPorter at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 3

Having persistent connections from clients to servers begins to move you out of the "Web Based" paradigm, at least in my opinion. You end up needing protocol converters on the client, and unless they're written in Javascript, they become a deployment burden.

I think right now, WPF/E is a completely web based technology with zero deployment overhead (beyond the plugin) that you can use much the same way you'd use HTML but with much better 2D graphical capability - in these cases your protocol of choice is HTTP. It's request/response and there's no persistent connection. I think the whole point of WPF/E is to stay as light as possible - if it gets too heavy it won't be considered a web technology.

If you want to use sockets, why not consider XBAP? You get the full power of the .NET framework, and as long as you play in the sandbox nice, you should be able to work with connection oriented protocols.

Kevgor at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 4

XBAP is simply too limiting since it requires the framework to be installed on the client.

Just look at Flash, a similar technology in many ways - it's been supporting these kinds of sockets for years. Deployment overhead = zero.

BillyPorter at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 5

I don't see anything in XmlSockets that you can't do with web services. Maybe you could let us know more specifics on what you're trying to do that isn't working for you.

If I have time I'll write a sample that listens for updates using a web service to demonstrate what I mean. Would that be useful?

BryantLikes at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 6

Thank you for your reply.

The socket implementation in Flash supports a persistent connection between the server and a its clients. This means that a Flash application running in the browser can keep its connection with the server open the whole time, receiving and sending data in a continuous fashion. This provides the following benefits:

* The client does not have to poll the server to check for new data
* The data that is being transmitted can be extremely small (just the data - no headers needed)

To my knowledge, this can not be accomplished through web services since they use the stateless HTTP protocol that would require the client to repeatedly poll the server (and passing in a whole lot of HTTP & SOAP headers each time).

BillyPorter at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 7
One easy example of applications that pretty much require sockets is MP games. In some very limited cases you can get away with polling, but in general: no sockets = no MP games in WPF/e. One of the reasons Adobe introduced binary sockets in Flash 9 is the issues developers experienced with Flash8 xml sockets. I think MS should learn from Adobe's mistakes and not repeat them.
nooneimportant at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 8

I couldn't agree more.

So the question still hasn't been answered: Do you (MS people :)) plan to support sockets in WPF/E?

Thanks in advance.

BillyPorter at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 9
Am I really the only one interested in this functionality :-) ?
BillyPorter at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 10
Hi,

probably yes, or can you imagine that more than one person on this planet would be bold enough to pass non text based data through the internet ? :-) Well, I might be the second one - some time ago I started asking for s.th. very similar - look here. Unfortunately this feature does not seem to have such a big lobby like the demanding for predefined user controls.

I′ve been told that this is a feature that is looked at, but I am not quite sure if this forum is THE place where the wpf/e developers get their feedback to rely on.

OK, I am not a designer but a programmer. I can′t imagine that there would be a coder in this world who would′t like to see a powerfull socket communiation model implemented in a web based platform like wpf/e.

I agree that look and feel are important. But this shouldn′t be only an "iWPFE". So core functionality like communication should in my opinion be kept s.th. that is looked at. So I keep hoping and advocating inter-client-communication. ;-)

Regards,
immanuel

ImmanuelG at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 11

I also would LOVE to see the ability to have a persistent TCP/IP connection between a WPF/E browser client and a server. I am a developer for a multi-player game and right now we are looking at Flex 2.0/Flash as the solution because the persistent connection is possible there. If WPF/E supported this, I would almost certainlly push our team to use it, as we are doing the server in C# and staying all MS would be great. But without a persistent connection, we will be forced to use Flex/Flash instead.

Jamie

JamieHall at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 12
Same situation here - no word from MS though, which seems a bit strange to me.
BillyPorter at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 13
I'd also like to see sockets supported in Silverlight. I believe not including this functionality is an oversight that will be a regret later on. Flash has had this capability since Flash 5 I believe and it works very well when I've used it on prior projects. For the kinds of projects I'm planning AJAX isn't going to cut it, I need a real socket/persistent connection.
C.Lung at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 14
ok ok - I undestand that Silverlight is a base web technology without huge overhead - but ... come on ... a web technology without acces to the web? Smile

I'd like to do some cool stuff ... not being limited to use only XML-based web services. I'd love tu build a fancy IRC-Client or a Tool to control my web-enabled coffee machine ... so give me sockets.

And don't tell me to use another webcontrol I built with C# ... that's not what I want. I want a clean simple way to acces the net - without messing around with AJAX/WebControls/Whatever.

J.Szpilewski at 2007-9-7 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...
# 15
Yes i agree. The socket support will, besides supporting gaming platforms etc, enable silverlight to access embedded platforms.

guest at 2008-2-11 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) General Discussion...