Home > Back-end >  The function of Java have similar EventBus
The function of Java have similar EventBus

Time:12-03

RT, a socket between classes, use the EventBus sending messages inside, but now need to transplant this part function to PC
Produced in the original function, joined the class A socket ConnectSer, then ConnectSer have similar to the following code
 
While (true) {
Eventbus. GetDefault (). The post (new the RecvMsg ());
}

And then if a class B needs to accept that the RecvMsg class, as long as write a in B accept function can deal with this message

But this android code, now need to put this part into PC, assuming that thread class ConnectSer starts, I hope to receive the RecvMsg anywhere in the process of class, the class library of similar EventBus PC?

Note: the class libraries need to Windows 7/10, ubuntu14.04 and higher, CentOS6 and higher available on
  • Related