formating
This commit is contained in:
@@ -421,10 +421,10 @@ def daemonize(
|
|||||||
working_dir="/", stdin="/dev/zero", stdout="/dev/null", stderr="/dev/null"
|
working_dir="/", stdin="/dev/zero", stdout="/dev/null", stderr="/dev/null"
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Does the UNIX double-fork magic, see Stevens' "Advanced Programming in the
|
Does the UNIX double-fork magic, see Stevens' "Advanced Programming in the
|
||||||
UNIX Environment" for details (ISBN 0201563177)
|
UNIX Environment" for details (ISBN 0201563177)
|
||||||
http://www.yendor.com/programming/unix/apue/proc/fork2.c
|
http://www.yendor.com/programming/unix/apue/proc/fork2.c
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# first fork
|
# first fork
|
||||||
|
|||||||
+1
-1
@@ -256,7 +256,7 @@ class Host:
|
|||||||
def fixup(self):
|
def fixup(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
#def dispstate(self):
|
# def dispstate(self):
|
||||||
# if self.state in ["down", "overdue"]:
|
# if self.state in ["down", "overdue"]:
|
||||||
# state = "<b>%s</b>" % self.state
|
# state = "<b>%s</b>" % self.state
|
||||||
# elif self.state in ["up", "UP"]:
|
# elif self.state in ["up", "UP"]:
|
||||||
|
|||||||
@@ -1,20 +1,22 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import websockets
|
import websockets
|
||||||
|
|
||||||
|
|
||||||
async def hello():
|
async def hello():
|
||||||
uri = "ws://localhost:50005/messages"
|
uri = "ws://localhost:50005/messages"
|
||||||
async with websockets.connect(uri) as websocket:
|
async with websockets.connect(uri) as websocket:
|
||||||
name = "Andreas"
|
name = "Andreas"
|
||||||
|
|
||||||
await websocket.send(name)
|
await websocket.send(name)
|
||||||
print(f"> {name}")
|
print(f"> {name}")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
greeting = await websocket.recv()
|
greeting = await websocket.recv()
|
||||||
print(f"< {greeting}")
|
print(f"< {greeting}")
|
||||||
if greeting == "bye":
|
if greeting == "bye":
|
||||||
break
|
break
|
||||||
|
|
||||||
|
print("out of here")
|
||||||
|
|
||||||
print('out of here')
|
|
||||||
|
|
||||||
asyncio.get_event_loop().run_until_complete(hello())
|
asyncio.get_event_loop().run_until_complete(hello())
|
||||||
|
|||||||
Reference in New Issue
Block a user