add socket functions for listener