static void /* will be called by ISO server stack */ isoConnectionIndicationHandler(IsoConnectionIndication indication, void* parameter, IsoConnection connection) { MmsServer mmsServer = (MmsServer) parameter; if (indication == ISO_CONNECTION_OPENED) { MmsServerConnection* mmsCon = MmsServerConnection_init(0, mmsServer, connection); Map_addEntry(mmsServer->openConnections, connection, mmsCon); if (mmsServer->connectionHandler != NULL) mmsServer->connectionHandler(mmsServer->connectionHandlerParameter, mmsCon, MMS_SERVER_NEW_CONNECTION); } else if (indication == ISO_CONNECTION_CLOSED) { MmsServerConnection* mmsCon = (MmsServerConnection*) Map_removeEntry(mmsServer->openConnections, connection, false); if (mmsServer->connectionHandler != NULL) mmsServer->connectionHandler(mmsServer->connectionHandlerParameter, mmsCon, MMS_SERVER_CONNECTION_CLOSED); if (mmsCon != NULL) MmsServerConnection_destroy(mmsCon); } }
static void closeConnection(void* con) { MmsServerConnection* connection = (MmsServerConnection*) con; MmsServerConnection_destroy(connection); }