Closed biohazardxxx closed 1 month ago
Maybe you can use a global pointer to store the socket?
Yes sure but if I want to decide on the type of socket based on EA settings (isServer) it requires late binding :-)
I think I didn't make myself clear.
Context context("myContext");
Socket *socket;
void OnInit(){
if(isServer)
socket = new Socket(context,ZMQ_REP);
// server init
else
// client init
...
}
This way, you can create either a server or client based on EA settings.
Is it somehow possible to do a late binding of socket? For example when having server and client code in one expert. As example this does not work: