replace all socket send/recv with message send/recv
add gate class for gate server