forked from LBRYCommunity/lbry-sdk
Removed more stuff
This commit is contained in:
parent
dc209e6b8f
commit
b110ab84fb
2 changed files with 0 additions and 56 deletions
|
@ -448,15 +448,6 @@ class Daemon(metaclass=JSONRPCServerType):
|
|||
if self.analytics_manager.is_started:
|
||||
self.analytics_manager.stop()
|
||||
|
||||
async def handle_pipe_request(self, data):
|
||||
data = json.loads(data)
|
||||
ledger = None
|
||||
if 'wallet' in self.component_manager.get_components_status():
|
||||
# self.ledger only available if wallet component is not skipped
|
||||
ledger = self.ledger
|
||||
result = await self._process_rpc_call(data)
|
||||
return jsonrpc_dumps_pretty(result, ledger=ledger)
|
||||
|
||||
async def handle_old_jsonrpc(self, request):
|
||||
data = await request.json()
|
||||
result = await self._process_rpc_call(data)
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
import asyncio
|
||||
import json
|
||||
import typing
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from typing import Optional
|
||||
from asyncio import transports
|
||||
|
||||
|
||||
path = r'\\.\pipe\lbrypipe'
|
||||
|
||||
class WindowsPipeProtocol(asyncio.Protocol):
|
||||
def __init__(self):
|
||||
self.transport = None
|
||||
self.closed = asyncio.Event()
|
||||
|
||||
def connection_made(self, transport: 'transports.BaseTransport'):
|
||||
self.transport = transport
|
||||
message = {'method': 'account_balance', 'params': {}}
|
||||
message = json.dumps(message)
|
||||
self.transport.write(message.encode())
|
||||
|
||||
def connection_lost(self, exc: 'Optional[Exception]'):
|
||||
self.closed.set()
|
||||
|
||||
def data_received(self, data: bytes):
|
||||
print(data.decode())
|
||||
self.transport.close()
|
||||
self.closed.set()
|
||||
|
||||
def eof_received(self):
|
||||
pass
|
||||
|
||||
|
||||
def windows_pipe_factory():
|
||||
return WindowsPipeProtocol
|
||||
|
||||
async def main():
|
||||
loop = asyncio.get_event_loop()
|
||||
transport, protocol = await loop.create_pipe_connection(windows_pipe_factory(), path)
|
||||
await protocol.closed.wait()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.set_event_loop(asyncio.ProactorEventLoop())
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(main())
|
Loading…
Reference in a new issue