Monitoring the number of TCP events in a stream