Some socket programming stuff.