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!
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!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi