• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Kind a push notification?

 
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have server that hosts our web application (written in Java). And we have one windows desktop application in C#. Now this desktop app app fetches data through web services from web app server. Now we need a way to make a call from server to this desktop app and pass some data.

For example, Whenever there is a new image file uploaded on server. Server needs to notify the desktop app that there is new file. Please download it. How can I do it?
 
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When desktop client starts, have it register a callback with the server.

For an example, is this no different than Microsoft Exchange server telling Microsoft Outlook that new mail has arrived in the user's mailbox ?
 
Saurabh Pillai
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roger Sterling wrote:When desktop client starts, have it register a callback with the server.

For an example, is this no different than Microsoft Exchange server telling Microsoft Outlook that new mail has arrived in the user's mailbox ?



In my case client is in C# and server is in Java (Spring framework). How do I implement "call back" functionality?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Callbacks won't work in all cases, though - if the client's IP is NAT'ed somewhere along the way, all bets are off. Even if there's a unique IP, the firewall likely won't allow incoming connections.

Unless there's a persistent connection, of course, but if that's feasible depends on how many clients you expect. And since you're calling it "push notification", I'm guessing that you don't want one.
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saurabh Pillai wrote:

Roger Sterling wrote:When desktop client starts, have it register a callback with the server.

For an example, is this no different than Microsoft Exchange server telling Microsoft Outlook that new mail has arrived in the user's mailbox ?



In my case client is in C# and server is in Java (Spring framework). How do I implement "call back" functionality?




I guess you would do this by following the tutorial...


It does not matter that one is written in one language and the other is written in a different language. Do you have a coach or mentor on your site?
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Callbacks won't work in all cases, though - if the client's IP is NAT'ed somewhere along the way, all bets are off. Even if there's a unique IP, the firewall likely won't allow incoming connections.

Unless there's a persistent connection, of course, but if that's feasible depends on how many clients you expect. And since you're calling it "push notification", I'm guessing that you don't want one.



Firewall rules are meant to be broken... (ie. changed by the System Administrator).

Persistence is not needed. Callbacks are asynchronous and do not require constant connection to the server.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I doubt the sys admins will be happy to change firewall settings just so such a scheme would work, and justifiably so IMO. It seems more realistic to constrain it to inside of the firewall, and possibly implement an additional pull option if it needs to work outside of it as well.
 
Saurabh Pillai
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Callbacks won't work in all cases, though - if the client's IP is NAT'ed somewhere along the way, all bets are off. Even if there's a unique IP, the firewall likely won't allow incoming connections.

Unless there's a persistent connection, of course, but if that's feasible depends on how many clients you expect. And since you're calling it "push notification", I'm guessing that you don't want one.



This is what my application is. We have a desktop app written in C# (Somebody else manages it. I work on server side which is Java(Spring Framework)). Desktop program is a Player which plays the playlist (list of images and videos). Desktop app calls the server to down the playlist through web service. All is fine so far. Now if somebody changes the playlist contents, server needs to send the notification to the player that contents has changed and please update your playlist. So client calls the server again and update the playlist (by downloading the new contents). This is the full cycle. The problem is how does server inform the client?

And my company is planning to sell the player as a product so we won't have access to customer's WIFI router, obviously. I am wondering how does any web chat works (like gmail chat)? It works on any network and it pushes the message to all devices which have gmail talk open like browser or phone.

Thank you for your time.
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:I doubt the sys admins will be happy to change firewall settings just so such a scheme would work, and justifiably so IMO. It seems more realistic to constrain it to inside of the firewall, and possibly implement an additional pull option if it needs to work outside of it as well.



In my experience, the system admins will do what the business leaders tell them to. And if this is a valid business requirement, then why shouldn't they ?

Ulf - so you are saying that people shouldn't use Microsoft Outlook ? What gives ? The proposal does nothing more or less than the network transaction between MS Exchange and MS Outlook .
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saurabh Pillai wrote:

Ulf Dittmer wrote:Callbacks won't work in all cases, though - if the client's IP is NAT'ed somewhere along the way, all bets are off. Even if there's a unique IP, the firewall likely won't allow incoming connections.

Unless there's a persistent connection, of course, but if that's feasible depends on how many clients you expect. And since you're calling it "push notification", I'm guessing that you don't want one.



This is what my application is. We have a desktop app written in C# (Somebody else manages it. I work on server side which is Java(Spring Framework)). Desktop program is a Player which plays the playlist (list of images and videos). Desktop app calls the server to down the playlist through web service. All is fine so far. Now if somebody changes the playlist contents, server needs to send the notification to the player that contents has changed and please update your playlist. So client calls the server again and update the playlist (by downloading the new contents). This is the full cycle. The problem is how does server inform the client?

And my company is planning to sell the player as a product so we won't have access to customer's WIFI router, obviously. I am wondering how does any web chat works (like gmail chat)? It works on any network and it pushes the message to all devices which have gmail talk open like browser or phone.

Thank you for your time.



Asynchronous callbacks can use already open ports, or you can have installation instructions that tell the end user which ports need to be open. I'm not sure why Ulf thinks this is so illegal. I could list a thousand applications that do this now. Apple iTunes being one.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I said nothing of the kind. Don't distort my words.
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Windows 8.1 , the Windows Firewall automatically detects which ports you are trying to use, and if they are not open, prompts the user for permission to open them. You may still have to provide release notes about router port configurations that may be needed by your product.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I advise against any design that requires firewalls to be opened up, whether they be corporate or private. The security implications are clear, but in addition to that for the pragmatic reason of not scaring your customers - who I assume you want to pay for your product.

You haven't said why it's so important that clients be notified right when new files are available, though, as opposed to a minute or so later, when a client-poll solution could reasonable be expected to learn about it.
 
Saurabh Pillai
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:You haven't said why it's so important that clients be notified right when new files are available, though, as opposed to a minute or so later, when a client-poll solution could reasonable be expected to learn about it.



As I said earlier, when playlist contents change, server needs to notify the client(player) about the same, so that player can download the changed contents. Client-poll is you call server every minute,right? Isn't it a burden on server? whereas if you can push to clients, it is event based. And does not put load on the server. Now assume that we have 100 clients running, they would be calling server every minute in case of poll. This is why I am looking for PUSH notification kind solution.

I am wondering can not I implement something that Gmail chat or Skype uses? Thank you.


@Roger I am also looking at Async callback. I have two speed breaker right now. One is client is in C# and server is in Java. How to make them talk? I have little knowledge about how to implement it Java and C#. Thank you.

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saurabh Pillai wrote:Now assume that we have 100 clients running, they would be calling server every minute in case of poll.


Is 100 clients a realistic number? That's a very small number, 100 requests per minute would not begin to tax the server.
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A byte is a byte. If C# writes 0x37 to that byte and Java reads 0x37 from that byte, what difference does the implementation language make ?
 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic