I've a winform app that is connected to a sql server database and there are many pc client with the application installed. A standard desktop client/server application.
I want that a single client can communicate with all others, for example I want the administrator cand send a message to all clients. Something like SignalR fir asp.net.
I do not want that is the client that ask to database if there are messages, I want that all clients connects to a service that raise events like broadcast message or chat.
I prefer not to install something that needs a web server, but I will consider all your suggestions. Also I'd like to know if there is a specific name to this functionality so I can do a more accurate search.
thanks to all
Related
I'm building a server-client application that uses TCP/IP sockets to communicate and i want to build a web interface to manage things.
Technologies:
-TCP/IP Sockets;
-Entity Framework 6 Code First;
My solution consists of four projects:
1) Server (Console application, runs 24/7, recieves data and writes to the db);
2) Client (Console application, runs 24/7 sends data);
3) NetLib (Class Library);
4) Interface (WebForms, entered occasionally, shows data from the db);
As for reading and managing data I'm good because all of them are written to the DB by Server and read by the Interface. But I have an issue: I want to be able to execute actions from the interface such as "Send new config to the client". How should i approach this? Creating a new socket in the interface project and sending it to the client sounds really bad.
Desired solution would be that the Interface somehow "tells" the server to perform such action. How to achieve that?
When your client sends data to the server, have your server send a response (if you are not doing this already). The response can contain any commands that the client needs to perform (such as update client configuration).
Now, your WebForms program needs to inform the server of whatever actions it needs clients to perform. This can be done in many ways, depending on how your system is set up.
The WebForms program can write to the database and have the server read from it.
or
The server can listen on a socket and the WebForms program would connect to this socket. If the WebForms program does not know where the server is, the server could write its address (DNS name/IP address) to the database, and the WebForms program would retrieve this address from DB and connect.
or some other way that suits you
Currently we have windows desktop software that is installed at customer premises and the software is polling a WCF service every 10 mins for updates on data.
I wanted to change this a real-time so when there is a update on server it pushes data back to the desktop client or web client.
The desktop client may be offline i.e. PC can be switch off or application is not started. In this scenario we would like to messages or updates to be queued
As we only support windows desktop client application so I will be using .Net technology.
This is the architecture that I thought of, please let me know if there is a better way to achieve.
NServicebus is another excellant tool for this type of thing.
Please consider streaming / queue platforms such as:
Tibco RV
Aleri
RabbitMQ
Consider Microsoft message queue: https://msdn.microsoft.com/en-us/library/ms978430.aspx
For offline case you don't need any queue. The app will check for update when started. When online, you can keep open TCP or UDP connection to server and send update notification to client. It will be something like "Update notification service".
I am about to develop an application, in which the windows application will receive messages from the server when there is a new entry in server database. I am planning to do the same using xmpp and c# in asp.net. Is that a better way?
The scenerio is like this: Whenever a new entry is inserted into my sqlserver database, my windows application should be notified with that new entry. i.e. I want to push the message from the server to the windows application. How can I push the message using xmpp? Can I set the server as my company server? Or should I have to use jabber server itself?
Assuming there are multiple instances of the client running, then using some form of pubsub, like XMPP pubsub would be an appropriate solution. There are many pubsub solutions available, you will have to select the appropriate one based on all your requirements and/or restrictions.
If this functionality is considered business critical, then you should definitely be using your own server.
I don't know if any of the public XMPP servers have pubsub enabled and configurable by the public or not.
suppose if i want to develop a windows chat application then a chat server need be developed and client too. after developing chat server apps we can run that apps in a machine and chat client will be running another pc. if those pc is not in same network suppose chat server run in a USA machine and one chat client run in Germany machine and another run in UK machine. in this situation how communication will happen using internet. all the nachine have access internet so how one chat client will login to chat server and how two chat client will communicate with each other. i just want to how data will transfer from one client to another client via chat server. please give me concept or it would be better if anyone give me a reference of a any good .net based chat application where chat server and chat client will be there.........thanks.
Generally? I don't see how this is related to C#, but client-server architecture looks like this:
Client <-----> Server
For something like you're describing where two or more clients communicate with each other, you're just talking about adding multiple clients:
Client A <----
|
----> Server
|
Client B <----
If Client A wants to send a message to Client B, then Client A sends the message to the server with some sort of information indicating that it's intended for Client B. The server then examines the message, determines that it's intended for Client B, then relays that message over its connection to Client B.
This is the fundamental definition of client-server architecture. There are more advanced architectures that mix client-server with peer-to-peer, such as Skype. In a hybrid system, the connection from the client to the server typically only carries control messages (authentication, etc.) and requests for information on how to contact another client directly. The advantage to an approach like this is that it doesn't require all of the communication between A and B to flow through the server; A and B both connect to the server, but they then ask the server how to connect to each other directly, then use that direct connection for the bandwidth-intensive communication.
That's all an aside, really, though. You should read up on client-server architecture independent of any particular language or environment before you start down the road of developing an application.
WCF Web Service with the client polling the service (simple-basic scenario - easy to implement, not very efficient)
WCF Duplex Web Service with the server updating clients when needed (a bit more complicated)
TCP Socket-based solution, hardest to implement but permits much better control. There is a very good example in Matthew McDonald's book "Pro Silverlight 3"
i have the current scenario:
my app generates for each user an
valid system email address of form
lets say: uuid#website.com
when an user has a problem/question he can send an
email from any address to that
predefined system email address
the app should receive the emails sent by the user and process them(check for spam, insert in db)
in this scenario a possible first solution that i had in mind was to pool the emails addresses on a 15 minutes period, process them(spam or not spam) in an external desktop app(or similar) and insert them in a database.
because i want to do this in .net, C#, SQL server 2008, and it should run on a webserver is the below solution possible using WCF?
i create a WCF webservice that when an email is received by an email address it captures it and starts the processing procedure.
One problem i see with WCF from the start is that i don't think that it can auto react, the only way i used wcf until now was only for calling it directly and receiving a result. So i think another layer should be put between the email server and the wcf service and that layer should "react" when something is received.
the main idea is to process the emails as they arrive not to be pulled out of the inbox periodically.
any pointers? thank you
You are right. A web service cannot capture anything for you. You will have to call(using an .ashx/or etc) the web service. That is what the web services are for, to be called.
the app should receive the emails sent by the user and process them
It sounds like you are looking to develop an email client; if so, then how about:
Create an email client app (for instance here)
Create a windows service, to help process the mails.
Assuming that you've tailored the client program, the windows service would work-with the client, look for new messages, and processes them accordingly.
For email client examples, checkout:
This answer
And this article
If connecting to Exchange 2007 SP1 or later Exchange Web Services looks like the best approach:
Read MS Exchange email in C#