Java TCP流在每次连接后都必须重新创建吗?

huangapple 未分类评论49阅读模式
英文:

Do Java TCP streams have to be recreated after each connection?

问题

我正在开发一个J2ME应用程序,但套接字行为可能与J2SE相似,而且几乎没有人在使用J2ME,所以我认为值得了解J2SE是如何处理的。
当我发送一个TCP消息,然后接收一个响应时,是否应该无法继续使用先前发送消息的流?我必须要特意关闭先前的连接并创建一个新连接吗?

英文:

I'm working on a J2ME application but it's likely socket behaviour is similar in J2SE and almost no one is using J2ME so I think it's worth understanding how J2SE does it.
When I send a TCP message, then receive a response, am I supposed to be unable to continue using the streams from the previous message sent? Must I go out of my way to destroy the previous connection and create a new one?

huangapple
  • 本文由 发表于 2020年6月29日 03:20:47
  • 转载请务必保留本文链接:https://java.coder-hub.com/62627214.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定