add 2 thread class

one receive thread and one send thread
modified to use the two threads
modifid to be the same with the cmpp protocol