socket: check also array size after event processing