Browse Source

make sure that thing get closed down properly..

irr_shared
John-Mark Gurney 3 years ago
parent
commit
f2ccc802fd
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      multicast.py

+ 10
- 0
multicast.py View File

@@ -27,6 +27,12 @@ class StupidProtocol(object):
def __init__(self):
self.transport = None

def close(self):
return self.transport.close()

def connection_lost(self, exc):
self.transport = None

def connection_made(self, transport):
# Note: the connection_made call seems to be sync. This
# isn't documented, and I don't know how to force a test
@@ -89,3 +95,7 @@ class TestMulticast(unittest.IsolatedAsyncioTestCase):

self.assertEqual((await l1.recv())[0], msg)
self.assertEqual((await l2.recv())[0], msg)

t1.close()
l1.close()
l2.close()

Loading…
Cancel
Save