Add assign API for Socket