How to create WPF internet chat application - c#

I want to create a simple chat application using C# and WPF that uses internet to connect between clients and server. I found a lot of tutorials for chat apps, but they all work over local network, I am confused and don't know to what technology to use to create my app. Could anybody point me in the right direction?

You really have a lot of directions you can go for this. The simplest is a simple plain sockets client-server star topography. This will work over both a public and private network, but you will encounter data theft as the data will be unencrypted.
For any internet application, you really should use the SslStream to secure your communications between the server and client. This allows you to specify TLS1.2 as your transport which will provide great security. You can consume that server stream from WPF via standard Sockets or from Windows Store Apps using StreamSockets. Mind you, you will need to learn a LOT about how SSL keys work and configuring the connections in code.

Related

WebRTC media server

two days ago I started looking into WebRTC, looked at a view examples and tested it a bit myself, and it looks really interesting.
However my qustion is, what would be a good way of implementing a WebRTC "media server" in c#. The media server should be able to connect two clients, not peer to peer, but peer to server to peer. So I can for example record conversations on the server or have a group meeting.
Would it be possible to create a Windows service, which you can contact from a web application like ASP.Net?
I already had tons of tabs opened and found Microsofts WebRTC-UWP-SDK as well as their ORTC. Would they be able to work in a Windows service, or should I use the WebRTC native code? Maybe it is also possible to create a connection via a normal RTP connection?
All WebRTC media servers I found are either written in c, c++ or NodeJS.
So does anyone have an idea, what would be a good solution to implement a c# WebRTC media server, which can run on a windows server?
Thank you all for your help.
I know and have used one before. The media server is based on .Net and has a lot of features and supports many programming languages and platforms. It is the Frozen Mountain's Liveswitch server.
See https://www.frozenmountain.com/products-services/liveswitch/ for more

communication between two emulators through server pc as middle man

i want to built an application which is communication network between two emulator. i have already connect emulator with server.
Now i want to connect two emulators through server(C#) which is PC. like we sent sms through mobile networks.
I need guidance to start this.
I am not sure what your requirements are and how far you would go to implement best practices, however, here are some points to consider based on my experience on a similar application, just to make it clear we worked on a solution where many Android phones would connect to a server to send/receive data.
Web Service is the way to go, this is what web services are meant for, we created WCF based APIs for the applications connecting to the server.
You are working on a heterogeneous system Java on Android, C# on the Server, consider creating REST based APIs on the server for data transfer
Go through these to get a feel of what needs to be done onthe server...
http://www.codeproject.com/Articles/105273/Create-RESTful-WCF-Service-API-Step-By-Step-Guide
http://msdn.microsoft.com/en-us/library/dd203052.aspx
And this for what needs to be done at Android side...
http://docs.xamarin.com/android/tutorials/consuming_web_services
hope that helps....

C# P2P chat application design

I want to create a simple chat application that doesn't use an explicit server. The main requirement is that the user can simultaneously chat with many friends (just like on Skype etc.). I do not mean a conference chat here, just multiple separate chat-windows.
Currently, I want only a LAN messaging application but I'd appreciate, if the design was easy to extend to Internet connections.
I wonder what design is appropriate for such an application.
What do you think about a solution, where each user app has a TcpListener (the implicit server) and multiple TcpClient objects - one for each friend he/she is talking to.
What about authenticating the remote users? Should the chatting app generate a certificate (X509 or sth) or just assume that the users in a LAN are to be trusted :)
Kindest regards,
HttpListener + WebClient(or HttpWebRequest) can provide you more tools for authentication/security.
Basic Authentication, Ntlm, Integrated Windows Authentication, https etc. and they are more firewall friendly.
You should see start with
how do i make my own P2P software?
WCF / WPF Chat Application
P2P Communication - Proxy Listeners and Proxy Clients
Hope this proves good starting point
Happy coding

is there a way to let the web server (not the Client which is the trivial case) send a messege to a Client application?

I'm about to start to develop and application in C# but I realized that I haven't the enough knowledge to develop it yet :S.
The thing's that I need to find out a way to let the Web server comunicate with my application, i.e., in short, is there a way to let the web server (not the Client which is the trivial case) send a messege to a Client application?
I know that I way to solve it's to make Client applications periodically send messages to the web server but that's not what I want 'cause polling generates overhead
Sorry about my english! I'm not a native speaker.
Thanks in advance!
Generally this type of interaction is achieved with Comet or WebSockets - I'm not sure how your app will be communicating with the server, but I would bet you can do what you're trying to do using one of those.
You could implement a WCF service in your client that could listen for a connection from the server (or anything else). The server can communicate with the client as easy as calling the API.
Getting started with WCF is really easy using the wizards in VS.
Here is a link that talks about using WCF with ASP, but it can be used outside of asp as well.
It seems like you meant "push" messaging, the challenge around this is for the server to keep track of the lost of clients and manage who should recieve which message.
If you want to get it done with minimal overhead you can check out the Amazon Simple Notification Service.
SNS is a cloud-based messaging and notification service hosted and managed for you, SNS is based on a topic/subscriber model and you set it up via a few simple API calls, it is metered but quite inexpensive for the most part.
edit: For C# Libraries and frameworks to do it yourself, I am not an expert in the C# world so I think other answerers will know it better.
Disclosure: I work at amazon so I am naturally inclined to like their product

Strategy for WCF server with .Net clients and Android clients?

I am using WCF to write a server that should be able to communicate with .Net clients, Android clients and possibly other types of clients.
The main type of client is a desktop application that will be written in .Net. This client will usually be on the same intranet as the server. It will make an initial call to the server to get the current state of the system and will then receive updates from the server whenever a value changes. These updates are frequent, perhaps once a second.
The Android clients will connect over the Internet. This client is also interested in updates, but it is not as critical as for the desktop client so a (less frequent) polling scenario might be acceptable.
All clients will have to login to use the services, and when connecting over the Internet the connection should be secure.
I am familiar with WCF but I am not sure what bindings are most appropriate for the scenario and what security solution to use. Also, I have not used Android, but I would like to make it as simple as possible for the person implementing the Android client to consume my services. So, what is my strategy?
with the small bit of android I have done.
the android sdk doesn't natively support soap server, you have to write it all your self.
Rest is your only option when working with WCF and android. Thats the way that Google are pushing you to develop apps.
WCF via HTTP transport is the way to go because it is not binary and does not make assumptions re all peers are .net/windows.
see this page for more info

Categories

Resources