add socket API for matching