updated the code to allow for a reconnect to server if a different server failed to get the needed chunks. found some portability issues with mac osx and linux etc.