forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/test2' into 0.9.2
- Loading branch information
Showing
7 changed files
with
203 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python3 | ||
"""This plugin is used to check that updated connection hints work properly. | ||
""" | ||
from pyln.client import Plugin | ||
|
||
import socket | ||
import time | ||
|
||
plugin = Plugin() | ||
|
||
|
||
@plugin.async_method('waitconn') | ||
def wait_connection(request, plugin): | ||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
sock.bind(('localhost', 0)) | ||
sock.listen(1) | ||
print("listening for connections on port {}".format(sock.getsockname()[1])) | ||
|
||
# We are a one and done socket connection! | ||
conn, client_addr = sock.accept() | ||
try: | ||
print("connection from {}".format(client_addr)) | ||
time.sleep(3) | ||
|
||
finally: | ||
conn.close() | ||
|
||
print("closing socket") | ||
sock.close() | ||
|
||
|
||
plugin.run() |
Oops, something went wrong.