rmi vs servlets vs sockets

后端 未结 3 1896
忘了有多久
忘了有多久 2020-12-28 18:05

what is the difference between socket programming, rmi and Servlets. When to use what?

3条回答
  •  生来不讨喜
    2020-12-28 18:21

    Use sockets to implement a specific TCP/IP protocol, whether an existing standard or your own custom protocol. You have complete control over all aspects of network communication.

    Servlets support request/reply semantics in the general sense, but it far more likely you will be using HTTPServlets which support, as expected, the HTTP request/reply semantics. For example, a web-server, or a RESTful HTTP based endpoint.

    Use RMI for distributed Java Objects. RMI is itself implemented using Sockets (see above) and implements the Java Wire Protocol.

提交回复
热议问题