我正在尝试在我们的 Spring-rmi 应用程序中实现自定义套接字工厂以进行压缩。
以下是 rmi-server 配置:
<bean id="parentRmiServiceExporter" class="org.springframework.remoting.rmi.RmiServiceExporter" abstract="true">
<property name="registryPort" value="${rmi.port}"/>
<property name="registerTraceInterceptor" value="false"/>
<!-- gZip Server and Client Socket Factory -->
<property name="clientSocketFactory" ref=egsZipClientSocketFactory/>
<property name="serverSocketFactory" ref="egsZipServerSocketFactory" />
</bean>
压缩流基于以下实现:
http://jmvidal.cse.sc.edu/csce790/handouts/sockets/CompressionInputStream.java.html
但是我在 rmi 客户端启动时遇到以下错误:
Caused by: java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method) [rt.jar:1.7.0_15]
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) [rt.jar:1.7.0_15]
at java.net.SocketOutputStream.write(SocketOutputStream.java:132) [rt.jar:1.7.0_15]
如何使用 spring-rmi app 实现压缩?