astroeng / Weather_Station

0 stars 0 forks source link

DataManager application crashes seemingly at random #7

Closed astroeng closed 8 years ago

astroeng commented 8 years ago

I think this might be related to losing the network connection to the internet.

astroeng commented 8 years ago

Tracked this down to the gethostbyname call. The function would seemingly never return if the connection to the resolver could not be established. In researching the possible cause, I learned that it is a deprecated call and getaddrinfo should be use instead. I restructured the code to use getaddrinfo and that seems to have done the trick. Connections to the phant server now fail as expected if the resolver cannot be reached. Fix in commit 952277a2661deb6628e3f101e14bcf6241f886cf

astroeng commented 8 years ago

Finalized in commit f722300dad6ad057dba4fe5308e8f13450ba7967