Java套接字编程输出流不向服务器发送数据
我正在使用PrintWriter写入服务器流,然后服务器根据命令发回数据。这一切都是在客户端类中完成的,每个命令都有自己的方法,这些方法被一个接一个地调用。问题是,在第一次连接后,服务器发送数据,但对于第二种方法,流停止工作,我尝试创建套接字和流的新实例,但仍然没有得到任何东西。没有 Runnable 接口用于向服务器发送或从服务器接收。那可能是什么问题?我可以在这里发布我的代码,但代码很多,所以我不知道是否应该。
提前致谢。
I am using PrintWriter to write to the server stream, and then server sends back the data according to the command. This is all done in a client class and every command has its own method which is called one after the other. The issue is that after the first connection, server sends data but then for the second method, stream stops working, i have tried creating new instances of socket and streams but still not getting anything. No Runnable interface is used to send to or to receive from server. What could be that issue? I can post my code here but its a lot of code so I don't know if i should.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论