bisocket 0.0.2a3__tar.gz → 0.0.2a4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bisocket
3
- Version: 0.0.2a3
3
+ Version: 0.0.2a4
4
4
  Summary: bisocket is a high-level Python library for simple, secure, and truly bidirectional socket communication, using a dual-socket architecture to enable non-blocking, full-duplex I/O. It provides automatic AES-GCM encryption and supports both synchronous (threading) and asynchronous (asyncio) client-server applications
5
5
  Home-page:
6
6
  Author: Daniel Olson
@@ -473,6 +473,8 @@ class Client:
473
473
 
474
474
  @dataclass
475
475
  class ServerRequest:
476
+ client_id: str
477
+ request_id: str
476
478
  method: str
477
479
  data: bytes
478
480
  send_data: Callable[[bytes], None]
@@ -529,7 +531,7 @@ class Server:
529
531
  pass
530
532
  return data
531
533
 
532
- def handle_requests(self, s, q: queue.Queue, request_q: queue.Queue, loop=None):
534
+ def handle_requests(self, client_id: str, s, q: queue.Queue, request_q: queue.Queue, loop=None):
533
535
  method, request_id, data = self.decrypt(self.server_receive(s)).split(SPLIT_TOKEN)
534
536
  send(s, b'ok')
535
537
 
@@ -541,6 +543,8 @@ class Server:
541
543
 
542
544
  request_q.put_nowait(
543
545
  ServerRequest(
546
+ client_id,
547
+ request_id.decode(),
544
548
  method.decode(),
545
549
  data,
546
550
  get_send_data_func(request_id)
@@ -577,7 +581,7 @@ class Server:
577
581
  # self.handler(ServerRequest(method.decode(), data, send_data))
578
582
  # method, request_id, data = self.decrypt(self.server_receive(s)).split(SPLIT_TOKEN)
579
583
 
580
- t = threading.Thread(target=self.handle_requests, args=(s, q, request_q), daemon=True)
584
+ t = threading.Thread(target=self.handle_requests, args=(client_id, s, q, request_q), daemon=True)
581
585
  t.start()
582
586
 
583
587
  while (request := request_q.get()) is not None:
@@ -656,7 +660,7 @@ class Server:
656
660
  pass
657
661
  return data
658
662
 
659
- async def ahandle_requests(self, s, q: asyncio.Queue, request_q: asyncio.Queue):
663
+ async def ahandle_requests(self, client_id: str, s, q: asyncio.Queue, request_q: asyncio.Queue):
660
664
  method, request_id, data = (await self.adecrypt(await self.aserver_receive(s))).split(SPLIT_TOKEN)
661
665
 
662
666
  while method != b'close':
@@ -667,7 +671,7 @@ class Server:
667
671
  q.put_nowait(SPLIT_TOKEN.join([req_id, data]))
668
672
  return send_data
669
673
 
670
- await request_q.put(ServerRequest(method.decode(), data, get_send_data_func(request_id)))
674
+ await request_q.put(ServerRequest(client_id, request_id.decode(), method.decode(), data, get_send_data_func(request_id)))
671
675
  # self.handler(ServerRequest(method.decode(), data, send_data))
672
676
  method, request_id, data = (await self.adecrypt(await self.aserver_receive(s))).split(SPLIT_TOKEN)
673
677
 
@@ -689,7 +693,7 @@ class Server:
689
693
  await async_send(s, self.encrypt(b'ok'))
690
694
 
691
695
  s.setblocking(True)
692
- t = threading.Thread(target=self.handle_requests, args=(s, q, request_q, asyncio.get_running_loop()), daemon=True)
696
+ t = threading.Thread(target=self.handle_requests, args=(client_id, s, q, request_q, asyncio.get_running_loop()), daemon=True)
693
697
  t.start()
694
698
  # asyncio.create_task(self.ahandle_requests(s, q, request_q))
695
699
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bisocket
3
- Version: 0.0.2a3
3
+ Version: 0.0.2a4
4
4
  Summary: bisocket is a high-level Python library for simple, secure, and truly bidirectional socket communication, using a dual-socket architecture to enable non-blocking, full-duplex I/O. It provides automatic AES-GCM encryption and supports both synchronous (threading) and asynchronous (asyncio) client-server applications
5
5
  Home-page:
6
6
  Author: Daniel Olson
@@ -20,7 +20,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
20
20
 
21
21
  setup(
22
22
  name="bisocket",
23
- version="0.0.2-alpha3",
23
+ version="0.0.2-alpha4",
24
24
  author="Daniel Olson",
25
25
  author_email="daniel@orphos.cloud",
26
26
  description="bisocket is a high-level Python library for simple, secure, and truly bidirectional socket communication, using a dual-socket architecture to enable non-blocking, full-duplex I/O. It provides automatic AES-GCM encryption and supports both synchronous (threading) and asynchronous (asyncio) client-server applications",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes