Finished new socket implementation