I was closing my IO streams too early, instead of when exiting or when the server was closed. I was closing them after each operation and since i closed them, they could not be reopened.