views:

22

answers:

1

Hi,

I'm working on a small flash project for a web site. I've coded my tcp-server on a windows service. Is it possible to put the tcp-server on a web service ? Or should I accept the tcp-connections while the web page is loaded?

Any suggestions? Really I do not know the way to put the server. [With windows service it works, but I have to pay to a dedicated server monthly over 50£, if it is possible with web service i will need only IIS]

Thanks!

I've used for server C#

A: 

You should look into using WCF, which can be hosted within ASP.NET. But beware that if you're hosting this on a managed hosting platform, they're likely going to be blocking all ports beyond 80 and 443. So if your socket server is dedicated to just sockets, you might be able to use port 80, but then again, their infrastructure may not play nicely with that either.

Update:

When I said "managed hosting platform" I was mostly referring to virtual hosts. Those are typically very restricted in what they're allowed to do, so they'd most likely be blocked from listening on a TCP port. And the OS would probably block listening on port 80 also, since the web server (i.e. IIS) will be using that port.

With WCF, I believe you can set up bindings that basically implement comet functionality so you can do socket-like communication over HTTP, but this approach does not scale well (though it might be acceptable if you are going to have very lite usage).

Unfortunately, I don't know of any virtual hosting solutions that let you host a socket server. You might have to go with a dedicated host. Hopefully I'm wrong and there's something out there for your needs.

Jacob
Manage host platform ? I want to lease a virtual host, not a dedicated one, so i will pay yearly 100£. My website do not need a huge bandwidth or ram
yazilimci
See my update. When I said "managed hosting platform" I was referring to a virtual host.
Jacob
Thanks for the update ... I will make a small WCF project and see how it works. If I have to use any dedicated service than I will use a windows service.
yazilimci