swapping for em-socket example code