| 212 | DECLARE_DYNAMIC_CLASS(PluginHostModule) |
| 213 | |
| 214 | bool OnInit() override |
| 215 | { |
| 216 | if(PluginHost::IsHostProcess()) |
| 217 | { |
| 218 | long connectPort; |
| 219 | if(!wxString{ CommandLineArgs::argv[2] }.ToLong(&connectPort)) |
| 220 | return false; |
| 221 | |
| 222 | //log messages will appear in a separate window |
| 223 | //redirect to log file later |
| 224 | wxLog::EnableLogging(false); |
| 225 | |
| 226 | //Handle requests... |
| 227 | PluginHost host(connectPort); |
| 228 | while(host.Serve()) { } |
| 229 | //...and terminate app |
| 230 | return false; |
| 231 | } |
| 232 | //do nothing if current process isn't a host process |
| 233 | return true; |
| 234 | } |
| 235 | |
| 236 | void OnExit() override |
| 237 | { |