In reply to Muthamizh:
Because, write method from monitor is called outside the forever begin. ideally when, you sampled anything from interface it should be write to analysis port.
please find the link, it is showing packet received messages from scoreboard.
Link:-