We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent abc7556 commit f34f14dCopy full SHA for f34f14d
.hosts.erlang
@@ -0,0 +1 @@
1
+'localhost'.
epmd.py
@@ -0,0 +1,35 @@
+# coding: utf-8
2
+
3
+import asyncio
4
+import functools
5
6
+import bitstring
7
8
9
+class EPMDProtocol(asyncio.Protocol):
10
11
+ def __init__(self, loop):
12
+ self.loop = loop
13
14
+ def connection_made(self, transport):
15
+ print('Connecting to EPMD...')
16
17
18
+ def data_received(self, data):
19
+ print('Reived data: {!r}'.format(data.decode()))
20
21
+ def connection_lost(self, exc):
22
+ print('Connection to EPMD closed')
23
+ self.loop.stop()
24
25
26
+loop = asyncio.get_event_loop()
27
28
+coro = loop.create_connection(
29
+ functools.partial(EPMDProtocol, loop),
30
+ '127.0.0.1',
31
+ 4369
32
+)
33
34
+loop.run_until_complete(coro)
35
+loop.close()
0 commit comments