implementing socket thread

Signed-off-by: Loyid Kim <thepuruya@gmail.com>