Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

close stream  RSS feed

 
Susilo Saja
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
- Does an IO stream have timeout?
- If we exit an application, does all the IO stream opened by that application get closed automatically?
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Susilo Saja:
Hi,
- Does an IO stream have timeout?

An IO Stream does not, but the resource the IO stream is connect to may (i.e. network socket).

[QB
- If we exit an application, does all the IO stream opened by that application get closed automatically?[/QB]

Yes, but it is bad programming practice to depend on it. You should free all resources in the finally block of your try-catch-finally sequence so they are returned to the system even in the event of an exception being thrown.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!