provide socket when define external events