Java standard for client / server communication

What is the "official" Java API for client / server or P2P communication? Java RMI? Other network APIs??

Is this official network API the standard of Se and EE?

I'm sure the answer is context specific, so let's look at a few examples:

>You have installed two swing clients on two computers and are connected to the same network (or Internet), and you want either of them to send another primitive, such as integer 4, or some POJOs, such as "widget" Object > which is #1 the same as above, but between the swing client and the fully compatible Java EE backend (managed beans, APP servers, and the entire 9-code)

I don't have a specific application, I just want to know what is the "specification" of client - client and client - server communication in the Java world

Solution

If Java constraints are not a problem, RMI is a very abstract solution when the client and server solutions "exchange" data (especially when the data is a Java class, it may be difficult / too much effort to express as text data) Just make sure your objects are serializable, and almost anything can be transmitted over the network

If this does not match your bill and you want to delete the original network content, the client server socket framework netty is a good choice

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>