• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Streamconnection, how to use input and output without closing

 
martin filton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using socket in a chat application.
Streamconnection should be fine to use here.
But do I have to shut down one of the streams before using the other?
I have to do this after sending a message to the server, if I don't I can't read from the inputstream.
 
Joel Karimpil
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using a simple inputstream and outputstream for my appn.
but it works even if i close my ouputstream.
 
Joel Karimpil
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am sorry
i meant to say it works even if i do not close my outputstream.
 
martin filton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joel.
I discovered some problem on my server-side. I was waiting for the stream to end but my client did never end the stream, I had to add a '\n' on the string I sendt from the client.

-Martin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic