add socket delegate mothod