Implements the local socket functionality