问题
What is the easiest way to transfer files over RMI ?
回答1:
RMI is a poor choice for this application. There is too much implicit data copying, and too much latency if you use multiple method calls.
Use a socket or an HTTP connection. See my answer in this question for a general-purpose solution.
I don't know why you are so fixated on using RMI for this. You've posted half a dozen questions on it, and you've already been told several times, e.g. now-deleted here, that it isn't suitable, or part of an overload avoidance strategy as you claimed.
来源:https://stackoverflow.com/questions/50684395/java-file-transfer-over-rmi