• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

how can a server PUSH client?

 
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello
i use the swing write the client-side console,but this client side console fuction not as normal,it don't receive info ACTIVATELY, it works as a monitor to superwise other computer(i call it server),the server push data to the client-side console,that means the swing client PASSIVATELY get info,one info item arrived,the one item is displayed on a table within the client console.
who can tell me,what's the better solution to my requirement,socket or rmi?and how?
thank you very much!
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't done RMI beyond a simple Sun tutorial, but I'd contrast them this way. Sockets is a message sending paradigm. The sender has to do some work to compose the message as a stream of bytes and the receiver has to do some work to interpret the message. RMI moves you up a level of abstraction (usually a good thing) and lets you think in more object and method terms. Sockets are pretty much language and platform independent. RMI is a Java-to-Java thing.
Either way, your "client" monitor has to open a serversocket or make itself an RMI server, and the "server" machine acts as a client. This reversal of normal roles is potentially confusing, but works out quite nicely. Let us know what you decide and how you make it work!
 
reply
    Bookmark Topic Watch Topic
  • New Topic