Skip to main content

Microsoft Silverlight

Answered Question Socket ServerRSS Feed

(0)

lars67
lars67

Member

Member

4 points

8 Posts

Socket Server

We are just testing Beta.3 and socket server functionality and cross domain files. but have some problems.
We have made a financial application in Adobe Flex, and we are thinking of porting this to Silverlight, now that it is becomming mature and with a set of controls.

A problem though, our Streamserver runs on port 80, which the silverlight app. must connect to (since many banks does not have other ports than this open)
The Streamserver also sends out a cross-domain file.:

<?xml version="1.0" encoding ="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from>
          <domain uri="*"/>
      </allow-from>
      <grant-to>
        <socket-resource port="80" protocol="tcp" />
      </grant-to>
    </policy>

  </cross-domain-access></access-policy>
 This doesn´t work. Any ideas? The documentation on the .NET is very confusion and of various quality
Thanks in advance

lars67
lars67

Member

Member

4 points

8 Posts

Re: Socket Server

For those interested This is the application in question:

http://www.softcapital.com/radarlite

The first think that happens when you connect, is that the streamserver sends out a cross-domain file giving access to port 80. But not in SIlverlight so far. :-(

andulvar
andulvar

Member

Member

155 points

102 Posts

Re: Socket Server

Silverlight applications can only connect to sockets in the range 4502-4532.  You cannot use port 80 for your application.  There's a somewhat heated conversation on this topic here:  http://silverlight.net/forums/p/81467/192712.aspx

 

lars67
lars67

Member

Member

4 points

8 Posts

Re: Re: Socket Server

*** Sad

No reason for us to even consider porting to Silverlight parallelly with our Flex application. It would be a completely no-go not to use port 80 to access the stream. Much people would use our application during work hours, beeing at work, and other ports that web, FTP, STMP will be closed.
Too-bad, we could have used the multi-thread capability of Silverlight which is not present in Flex.

codeblock
codeblock

Contributor

Contributor

4060 points

716 Posts

Silverlight MVP

Re: Re: Re: Socket Server

If you need to use sockets ther is nothing to do.

But if you can change your transport you may consider the usage of a webservice.

But if you are talking about streams probably this is not your case.

What are you streaming?

 

If this answers your question, please "mark it as answer"

--
Andrea Boschin
MVP Silverlight & Silverlight Insider
, Me on Twitter

lars67
lars67

Member

Member

4 points

8 Posts

Re: Re: Re: Socket Server

Hello Andrea

We are streaming stockquotes from a socket server.

codeblock
codeblock

Contributor

Contributor

4060 points

716 Posts

Silverlight MVP

Re: Re: Re: Re: Socket Server

Have you seen the PollingDuplex
http://petermcg.wordpress.com/2008/09/03/silverlight-polling-duplex-part-1-architecture/

HTH

If this answers your question, please "mark it as answer"

--
Andrea Boschin
MVP Silverlight & Silverlight Insider
, Me on Twitter

davidezordan
davidezo...

Contributor

Contributor

5690 points

875 Posts

Silverlight MVP
Answered Question

Re: Re: Re: Re: Re: Socket Server

Hi,

I've posted an updated example of Duplex support in SL3 here: http://www.davidezordan.net/blog/?p=935

Hope this helps.

Thanks, Davide

Silverlight MVP

Blog Twitter Silverlight Experts

lars67
lars67

Member

Member

4 points

8 Posts

Re: Re: Re: Re: Re: Socket Server

Hi

Thanks for your suggestions. Smile

But it is simply not an option for us to start modifying our serverbase, this is standard socket servers, that has 3 different clients connected. We want to use standards that are not bound to OS´ses. So doing a WCF service, that is not released yet is not a viable option

We just hope that Msft realized that is is not neessary to make stricter restrictions that the one Adobe has imposed throught their Domain policies.

DonMoir
DonMoir

Member

Member

8 points

4 Posts

Re: Re: Re: Re: Re: Socket Server

Hi Lars, The lack of arbitrary socket ports is indeed silly. But even with Flash or even if SilverLight did support sockets over 80, you still need to support connections over HTTP. Some corporations behind proxies simply do not permit socket connections and you must go thru the proxy.

Here's a note for you: Flash in Internet Explorer has a problem with version detection. This is noted as Flash suddenly stops working in IE. It's not flash that has stopped working, it is the version detection that has stopped working.... Your site failed in IE because of it... saying you must install flash etc...

The version detection occurs in AC_RunActiveContent.js. You can read about my solution for the problem here:

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=675&threadid=1436087&enterthread=y

Here is my own version of socket and HTTP connection support in the form of a Real Time Blog:

http://sms.pangolin.com/rtblog/

Don

codeblock
codeblock

Contributor

Contributor

4060 points

716 Posts

Silverlight MVP

Re: Re: Re: Re: Re: Re: Socket Server

I've written a proof-of-concept project that explain how to tunnel socket ports in scenario like your.

http://www.silverlightplayground.org/post/2009/04/01/A-proxy-class-to-tunnel-Socket-channels.aspx

HTH

If this answers your question, please "mark it as answer"

--
Andrea Boschin
MVP Silverlight & Silverlight Insider
, Me on Twitter

DonMoir
DonMoir

Member

Member

8 points

4 Posts

Re: Re: Re: Re: Re: Re: Socket Server

Hi codeblock, I read thru your proof-of-concept. I have not written a single bit of Silverlight code but...

In my case the whole premise to connect out port 80. This is the least likely port to be blocked for sockets and not at all for HTTP.

As far as I can tell, you are assuming a client can connect out 943 etc. This is not necessarily the case. My server does not exist in the traditional web service back end so it can listen on port 80 just fine. It is quite happy to accept socket or HTTP connections. No need for it to listen on some other port such as 943.

My client code tries to connect out sockets first because it is the most efficient. If this fails it connects thru HTTP. This is a must for when behind a proxy that only allows HTTP connections. Now silverlight can also connect thru HTTP, so this is ok, but less efficient.

I could listen on any additional port as well but I have not need for it at this time. Java 1.6 and Flash allows you to connect out port 80 (socket or HTTP) cross-domain. It seems Silverlight should follow suit.

Don

 

codeblock
codeblock

Contributor

Contributor

4060 points

716 Posts

Silverlight MVP

Re: Re: Re: Re: Re: Re: Re: Socket Server

No, Silverlight cannot connect to port 80 using sockets because this port is out of the allowed range. And Sockets really need to connect to port 943 before establishing a connection to an allowed port. I hope this limits will be removed but for now we have to play with them...

bye

If this answers your question, please "mark it as answer"

--
Andrea Boschin
MVP Silverlight & Silverlight Insider
, Me on Twitter

m_peretz
m_peretz

Member

Member

5 points

9 Posts

Re: Re: Re: Re: Re: Socket Server

Polling duplex can not scale in web farm or even in a web garden...

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities