Serial port communication using WCF? - wcf

Are there any bindings to communicate on Serial port using WCF?

OK I couldn't find any workable solution. Thus started to build a custom channel.
http://wcfserialchannels.codeplex.com
Interested developers please join.

i dont know how to do it ,but here is a Codeproject article on how to make your own transport for WCF. You could make one for to use a serial port. I am not familiar with WCF so i dont know if this article can help you, but it looks promising.

Hard to say without knowing more about what you're up to, but probably easiest to take it down a layer. If you're just talking about two machines where you control both sides, set up a Dialup Networking PPP connection between the machines over a null modem and use WCF with standard HTTP or NetTcp over the pipe.

Related

How to properly tune network for Turn Server in a WebRTC application?

I'm working on a WebRTC solution for audio/picture comunication and I'm a bit concerned about the lack of bandwidth control when two Peers in LAN are communicating.
Basically I want to be able to prioritize and pre-allocate bandwidth on my switch for WebRTC calls. But I couldn't see a proper way of filtering the packets when they are in a P2P call.
Also, I don't want to decode the packet to do that, because of the possible delay caused by this operation.
I hope you guys can show me a proper way or just tell me if my teorical solution could work.
I'm not 100% sure about the idea I'm planning to test, because I don't know how TURN server works internally.
But here is the idea:
And what I dont know is: Is it possible to make 2 turn servers know each other? Would they work like a 2 layer proxy between callers? If yes, could you please show me what I have to do to make it work?
Just install a internal proxy server to the external turn server and prioritize the proxy on your lan.
(answering my own question after realizing the solution was easier than I thought)

c# wcf duplex communication

I have to write an online chess program using WCF. I'm new to service programming, so could you please give me some advice.
I thought of using duplex communication, so that the service could poll the database and call the client, if the opponent has made a new step. but I don't think this would be a quite optimal solution. Could you please tell me what better alternatives can be here?
Thanks a lot.
Depends on the type of clients that will use the service. If for example the clients are .NET clients you could use wcf Net.Tcp communication and set up a callback contract that the clients need to implement and the service can call when someone makes a move. If you use other type of clients polling is probably the best way to go.

client to server communication in VB.net

I made some code in vb.net which checks if a certain process is running, and returns a 1 if it is, or a 0 if it isn't. Now I want it to send a packet to my server or something which would log the IP of the client, or something similar.
What would be the easiest way to approach this?
There are a lot of different solutions to this task. First, which comes to my mind is WCF - maybe the easiest one as you do not think about opening ports, establishing the connections, parsing the input socket string and so on.
Here is on more link:
Introducing Windows Communication Foundation in .NET Framework 4

WCF: Why WCF for a Windows Forms application?

I want to develop a simple Windows Forms application in C# using WPF and MVVM that will connect to an SQL server installed on a different machine. So I've read that, even for a simple structure like that, some developers would use WCF and make their application Service Oriented. I totally understand that SOA is the way to go with WebApps and SilverLight, but I don't see why, for a simple situation like a Winform and an SQL Server, would somebody use WCF. I would really appreciate if somebody could give me a couple of good reasons why to use WCF in my WinForm application (considering that the SQL Server will be in the same network with the clients)?
Thanks,
Aris
If you don't need it, don't use it :)
But you should consider whether there are plans to change the application - for example, to convert it to a web app or Silverlight. In that case, having a service which does the database access will make the conversion easier. Personally, I think this is usually over engineering, but it may make sense for your application if you foresee one such change in the near future.
Do you have to use WCF? Nope.
In my opinion, though, there aren't too many reasons NOT to create a WCF service for this sort of work.
Using WCF services for your different layers instead of class libraries is an excellent way to go. Using WCF, you can control how your components are hosted (IIS and http all the way down to in-process with named pipes) and where they're located.
WCF doesn't add much overhead and in return you get a bunch of benefits.
The point isn't necessarily to worry about SOA, but more to think ahead about flexibility and better reuse.
I can't think of a particularly compelling reason, other than habit. When you do something the same way for 99% of your projects, it's often just as easy to do it the same way for the other 1% if it doesn't go actively against your requirements.
The only other reason I can think of would be if you're writing something that could, potentially, be really useful externally or as a web-app. Using WCF in that instance would allow any client which could connect to the host (web browser, external application, or whatever) to connect to your library without you having to modify things after the fact.
If you know for (relatively) certain that this will only be a windows application run on the desktop of your own organizations' employees, I don't see a reason to use WCF in this instance.
Bottom line is that you're on a network so WCF or any web service makes sense.
Your network calls are all going to be async (or should be!). That's easy to do with WCF. Not so much with direct connections.
Even WinForm applications are connected these days.
I personally don't believe in creating services for everything, just to be creating services. Create a service when you know that you have a consumer for that service. Don't just say, "well, we might use it from another application some day", and call that an excuse for a service.
Services should be planned. The service contracts should be those which are required by their consumers. No consumers, no contracts, so no service.

WCF duplex with DHCP?

I'm using a duplex WCF contract in this chat-like application that i have running. (obviously not really a chat, but for the interest of thinking about it you can assume it's similar enough).
the problem is that many of the clients that talk over this contract are running dhcp, and there's not really anything i can do about this.
What's the best way to handle duplex communication with dhcp? I found a setting <compositeDuplex clientBaseAddress="Uri"/> which means i could update this value at runtime.... seems a bit kludgy.
Update
I found that in my WCF server logs, part of the problem is that it was putting hostname in the response address. what am i doing wrong here?
thanks
To be blunt, the first thing that you're doing wrong is using DualHttpBinding to do duplex. That whole binding is a giant kludge and is prone to problems like this (and firewalls, oh god firewalls).
If you were to use something like net.tcp instead then the clients establish a single bidirectional connection to the server instead of needing two connections, and thus the server doesn't care if the client is on DHCP anymore.