Socket mid implementation