3.2.4.4.2 Releasing Reference Counts on an Interface
(self, ipid: uuid.UUID)
| 1458 | ) |
| 1459 | |
| 1460 | def RemRelease(self, ipid: uuid.UUID): |
| 1461 | """ |
| 1462 | 3.2.4.4.2 Releasing Reference Counts on an Interface |
| 1463 | """ |
| 1464 | |
| 1465 | # 1. Look up the OID entry |
| 1466 | ipid_entry = self.IPID_table[ipid] |
| 1467 | oxid_entry = self.OXID_table[ipid_entry.oxid] |
| 1468 | oid_entry = self.OID_table[ipid_entry.oid] |
| 1469 | |
| 1470 | # 2. Perform call |
| 1471 | resp = self.sr1_orpc_req( |
| 1472 | ipid=oxid_entry.ipid_IRemUnknown, |
| 1473 | pkt=RemRelease_Request( |
| 1474 | InterfaceRefs=[ |
| 1475 | REMINTERFACEREF( |
| 1476 | ipid=GUID(_uid_to_bytes(ipid)), |
| 1477 | cPublicRefs=ipid_entry.cPublicRefs, |
| 1478 | cPrivateRefs=ipid_entry.cPrivateRefs, |
| 1479 | ) |
| 1480 | ], |
| 1481 | ), |
| 1482 | ) |
| 1483 | |
| 1484 | # 3. Process answer |
| 1485 | if resp and resp.status == 0: |
| 1486 | # "When the call returns successfully..." |
| 1487 | # "It MUST remove the IPID entry from the IPID table." |
| 1488 | del self.IPID_table[ipid] |
| 1489 | |
| 1490 | # "It MUST remove the IPID from the IPID list in the OID entry." |
| 1491 | oid_entry.ipids.remove(ipid) |
| 1492 | |
| 1493 | # "If the IPID list of the OID entry is empty, it MUST remove the |
| 1494 | # OID entry from the OID table." |
| 1495 | if not oid_entry.ipids: |
| 1496 | del self.OID_table[ipid_entry.oid] |
| 1497 | |
| 1498 | |
| 1499 | def ServerAlive2(host, timeout=5) -> Tuple[List[STRINGBINDING], List[SECURITYBINDING]]: |
no test coverage detected