MCPcopy Create free account
hub / github.com/defold/defold / GetServicePort

Function GetServicePort

engine/engine/src/engine_service.cpp:485–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483 }
484
485 uint16_t GetServicePort(uint16_t default_port)
486 {
487 uint16_t engine_port = default_port;
488
489 char* service_port_env = dmSys::GetEnv("DM_SERVICE_PORT");
490
491 // editor 2 specifies DM_SERVICE_PORT=dynamic when launching dmengine
492 if (service_port_env) {
493 unsigned int env_port = 0;
494 if (sscanf(service_port_env, "%u", &env_port) == 1) {
495 engine_port = (uint16_t) env_port;
496 }
497 else if (strcmp(service_port_env, "dynamic") == 0) {
498 engine_port = 0;
499 }
500 }
501
502 return engine_port;
503 }
504
505 dmWebServer::HServer GetWebServer(HEngineService engine_service)
506 {

Callers 1

dmEngineInitializeFunction · 0.85

Calls 1

GetEnvFunction · 0.50

Tested by

no test coverage detected