Skip to content

Commit

Permalink
Begun socket client write down (no code yet, mostly doe the structure…
Browse files Browse the repository at this point in the history
… on paper up to now)
  • Loading branch information
Sbef98 authored and Paula-Kli committed Feb 9, 2022
1 parent ec10d38 commit 54282e1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
14 changes: 0 additions & 14 deletions .vscode/launch.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions Sender protocols/SocketProtocol.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from typing import Protocol
import protocol


class SocketCom:
"""
SocketCom is the single socket communication
"""
def __init__(self, remoteServer, port, beginTrigger=b'\xff', endTrigger=b'\xfe'):
inBuffer = Protocol(beginTrigger, endTrigger)


class ControllerFactory:
"""
It's our "Controller loop" in sockets.
It may be useful having a controller loop for the socket
communication too so that we can create SocketComs like a
factory pattern.
Why doing so?
If we need an high-throughput, we can
"""

def __init__(self, remoteServer, portRange=[8000, 9000]):
"""
portRange is useful in case i want to decide on which ports
range i want my sockets to work on!
"""
pass
2 changes: 1 addition & 1 deletion bridge/handler/message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,4 @@ def write(self, bytesToSend, device_id=None):

if __name__ == "__main__":
hand = SocketHandler(None, 8080, "localhost")
SocketHandler.loop()
SocketHandler.loop()

0 comments on commit 54282e1

Please sign in to comment.