Fixed a bug in the polling method of the socket class.