![]() |
1
3
在套接字上使用对象流实际上不是推荐的想法。您可以考虑使用完整的Web服务或RMI。 如果在尝试使用对象流进行反序列化之前读取缓冲区并确保拥有整个业务,那么它可能会更好地工作。 |
![]() |
2
2
为什么不使用黑森图书馆? 它就像一个魅力: http://karussell.wordpress.com/2009/04/10/hessian-web-service-protocol-hello-world-example/ 或者尝试弹簧远程处理(这不是很轻) http://static.springsource.org/spring/docs/2.5.x/reference/remoting.html |
![]() |
3
1
看起来客户机在写消息之前试图阅读确认。 |
![]() |
4
1
将“发送”和“接收”代码拆分为单独的线程,编写器线程可以写入套接字,而您的另一个线程在调用时被阻止。
如果这将是一个长期运行的客户机,我还建议使用较低级别的datainputstream和dataoutputstream,而不是objectinputstream/objectoutputstream,以防止保留对象的可能较大的identityhashmap。 |