views:

383

answers:

3

Tooday I use ServiceHost for self hosting WCF cervices.

I want to host near to my WCF services my own TCP programm for direct sockets operations (like lien to some sort of broadcasting TCP stream)

I need control over URL namespaces (so I would be able to let my clients to send TCP streams directly into my service using some nice URLs like example.com:port/myserver/stream?id=1 or example.com:port/myserver/stream?id=anything and so that I will not be bothered with Idea of 1 client for 1 socket at one time moment, I realy want to keep my WCF services on the same port as my own server or what it is so to be able to call www.example.com:port/myWCF/stream?id=222... and I want it to work on Any port - not only 80)

Can any body please help me with this?

I am using just WCF now. And I do not enjoy how it works. That is one of many resons why I want to start migration to clear TCP=)

I can not use net-tcp binding or any sort of other cool WS-* binding (tooday I use the simpliest one so that my clients like Flash, AJAX, etc connect to me with ease).

I needed Fast and easy in implemrnting connection protocol like one I created fore use with Sockets for real time hi ammount of data transfering.

So.. Any Ideas? Please - I need help.

A: 

If your problem with WCF is performance then you should try the binary net TCP binding to eliminate XML serialization to improve performance.

Some high traffic applications, like realtime games, use UDP for the majority of communication since it cuts through the protocol. With TCP you get ordering and reliability built in, but this comes at the cost of performance because it will implicitly delay packets to wait for out of order packets so that it can hand them to the application in the correct order, or wait for lost packets to be resent. Instead you can use UDP and implement your own scheme for verification of data that is less stringent than TCP.

There are UDP options available for WCF, or you could implement your own. WCF is nothing more than a message pump, and you can replace different steps with whatever you want.

AaronLS
I can not use net-tcp binding because it is quite difficult to connect to if from Flash and other stuff. I desperatly need Fast and more easy in implemrnting connection protocol like one I created fore use with Sockets for real time hi ammount of data transfering. My only problem with sockets connections is - I can not make them work in good pair with WCF (on same socket, so that my TCP server would be avaliable just as I call my WCF services - by simple yet readable adress)
Blender
And I can not USE UDP at all because my boss sad so and we realy need to be shure all data came to client
Blender
But what difference does UDP do in order to be sure that the data comes from the Client? Yes, you could asume with pretty good certanty that the IP adres is correct. But if it's a public site you wouldn't realy know what client is making the call.
Richard L
Richard is right. If you need some assurance of authenticity, that is the job of a cryptographic authentication scheme, not the job of the network protocol.
AaronLS
A: 

Not sure if this will help you or not, but try turning on your Net TCP Sharing Service.

pms1969
+1  A: 

Well if you're going to drop down to pure sockets, you could as well make your service act as proxy. Make WCF Services listen on some other port, and your app on the desired port. When you receive request in your app, manually parse header and check weather it is intended for your service or WCF Service. If it's intended for WCF service, open a TCP connection to WCF service and pass the received data to it, and then simply pass back WCF's answer to the client..

On the other hand you could speed up WCF quite a lot by writing your own custom binding. Lots of time WCF looses on serialization that is done using reflection (which is slow), going around this would improve your speed considerably.

Ivan