Update server and fix incorrect error detection in socket polling.