polling and socket