a wrapper of socket interface