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

Function New

engine/dlib/src/dlib/http_server.cpp:168–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 }
167
168 Result New(const NewParams* params, uint16_t port, HServer* server)
169 {
170 *server = 0;
171
172 if (!params->m_HttpResponse)
173 return RESULT_ERROR_INVAL;
174
175 Server* ret = new Server();
176 if (Connect(ret, port) != RESULT_OK)
177 {
178 delete ret;
179 return RESULT_SOCKET_ERROR;
180 }
181
182 ret->m_HttpHeader = params->m_HttpHeader;
183 ret->m_HttpResponse = params->m_HttpResponse;
184 ret->m_Userdata = params->m_Userdata;
185 ret->m_ConnectionTimeout = params->m_ConnectionTimeout * 1000000U;
186 ret->m_Connections.SetCapacity(params->m_MaxConnections);
187
188 *server = ret;
189 return RESULT_OK;
190 }
191
192 void Delete(HServer server)
193 {

Callers 1

ConnectFunction · 0.70

Calls 2

ConnectFunction · 0.70
SetCapacityMethod · 0.45

Tested by

no test coverage detected