update codes struct
update socket read/write
update msg trans logic