Implemented socket accept thread.