generic purpose socket listener