Since the context is saved and restored inside the draw function the globalCompositeOperation will be restored straight after it's done drawing the received lines. Just tested, and you'll keep drawing without any errors even if you receive erasing-messages while drawing.