do recv and send msg callback func
add some config for chat