Windows Service With NotifyIcon - windows-services

I have to develop a TCP/IP server application that will entertain remote mobile clients to connect on some port and interact with each other. My plan is to build it as a windows service so that it may be managed on system level.
Windows Service
will start automatically listening to port and taking their requirements. A notify icon would be keep showing in system tray. If we will click on this notify icon, a form will be shown with current number of connected clients etc.
I have developed the code and tested it very well it works. But it doesn't show the Form.
Below is the code that starts service from Program.Main()
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new Service1()
};
ServiceBase.Run(ServicesToRun);
Am i Missing something?

Related

Windows service in starting state and can not make it in running state

I developed a windows service in C#. I followed some existing tutorials from google. In service.cs class the constructor is only holding the InitializeComponent() method. In OnStart() method I have written some code to open a port using TCPClient to connect via tcp connection to some other client. In that OnStart() method I am receiving a response from client using AcceptTcpClient() method and forwarding to an another class to process the client's response and send it back to the client. I maintained the coding fashion in ServiceInstaller and ServiceProcessInstaller and to start the service automatically adding up the event handler named AfterInstall and Commited. As I am installing the service, in service.msc it is showing service status as starting but the service is working as it should. Why the status is not showing running state?

Communication between asp.net app and a serviceworker, via signalR?

I'm new to serviceworkers and I wonder how could I connect my serviceworker to my asp.net application. My js client already is communicated with a service worker and it's able to show notifications.
However, I've seen that some webs (e.g facebook) send notifications even the browser's tab ins't opened (not inactive, not opened). I use signalR to communicate my app with the server. Would it be possible to communicate the serviceworker with the server? It would require to add signalR code to the serviceworker if I'm not wrong, but I don't think it's possible. I've seen that google has another way of communication, Google Cloud Communication
I can't use that, so any ideas of how could I solve this problem?
To make use of offline notifications (i.e., your browser is open but your page isn't), the browser itself needs to know about a messaging service that it can respond to, and which would let it know to wake up your service worker and give it a notification. These services are hard-coded into the browser. In Chrome's case, the service is GCM. And I believe Firefox is rolling out something of its own. You cannot wake up your service worker yourself from your server without going through one of these messaging services.
Remember that generally your service worker is asleep. The browser only wakes it up in response to specific events, and, if your pages are closed, there is no way to trigger a service worker event from your server, unless the browser provides a messaging service such as GCM.

Signalr connection state between two android activities

Now i'm try to developing android and multi client live chat application usin signalr. But i got a problem with signalr connection state. One thing is I don't know how to keep connection state between two android activities. Second is, I don't know how to keep signalr connection state in android. I tried to disconnect signalr connection state when android activity destroy, that's is ok but i got problem when user clean recent application from OS my android client is try to connect new connection oncreate. That's why i want to know how to keep Signalr connection state between android two activity and how to keep signalr connection state.
Another thing is should i use signalr for android instant messaging application. Because i want to create instant messaging application using signalr.
Thanks.

Best methods for implementing push services from Azure to Windows Service

I have a Windows Service that will be constantly waiting for a notification to do work.
All I can find in MSDN is how to set up push notifications for Store apps and mobile devices.
Is there a technology that would allow pushing to a Windows Service from Azure? The Windows Service will be running on Windows 7.
Using push services is not the greatest idea. Its really just meant for mobile and Win* store apps.
Look into using Azure Service Bus.
You could set up a queue and your windows service would just listen to that queue, and when it finds a message relevant to it, it will process it.

Can a native Blackberry application (not MIDlet) use MIDP Push Registry?

If I am writing a MIDlet, and if the device supports SMS push registration (i.e. supports WMA 1.1 spec), I will be able to send push messages to the application that is installed on the phone and is listening to SMS messages at the assigned port.
However, if I am writing a Blackberry application, can I still go ahead and use the procedure that applies to MIDP 2.0 devices. If so, can I specify static SMS push registration in JAD file, as we do for a MIDlet?
Would the appropriate JAD property be still specified as MIDlet-Push-1:{}?
Another question, that is not totally unrelated is- are there any bulk SMS providers that allow SMS bearers specify the destination ports that can be integrated with this kind of a solution?
Thanks
A regular blackberry application does not support the push registry. You'll have to keep a DatagramConnection open and listen for the incoming SMS messages that way.
DatagramConnection connection = (DatagramConnection)Connector.open("sms://:1234");
Datagram dgram = connection.newDatagram(connection.getMaximumLength());
connection.receive(dgram); // blocking call so this should be in a separate thread
String message = new String(dgram.getData());
where 1234 is the port you're listening on.
As to you're second question I'm not entirely sure, but I think mblox supports port directed SMS.
For the second question, if the bulk SMS service provider provides you with HTTP API which included the UDH field, you can send messages to application listening in that particular port

Resources