java.net versus java.nio

前端 未结 5 839
眼角桃花
眼角桃花 2020-12-05 14:49

At what point is it better to switch from java.net to java.nio? .net (not the Microsoft entity) is easier to understand and more familiar, while nio is scalable, and comes w

5条回答
  •  再見小時候
    2020-12-05 15:48

    Given the small number of connections involved, java.net sounds like the right solution.

    Other posters talked about using XML-RPC. This is a good choice if the volumes of data being shipped are small, however I have had bad experiences with XML-based protocols when writing inter-process communications that ship large amounts of data (e.g. large request/responses, or frequent small amounts of data). The cost of XML parsing is typically orders of magnitude higher than more optimised wire formats (e.g. ASN.1).

    For low volume control applications the simplicity of XML-RPC should outweigh the performance costs. For high volume data communications it may be better to use a more efficient wire protocol.

提交回复
热议问题