Skip to content

Commit

Permalink
added version support client
Browse files Browse the repository at this point in the history
  • Loading branch information
timoj committed Aug 22, 2019
1 parent aa0215c commit b5ec9c9
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.idea
*.pyc
listener_local.conf
listener_docker.conf
*.pyc
Binary file removed __pycache__/listener.cpython-37.pyc
Binary file not shown.
Binary file removed lib/socket/__pycache__/client.cpython-37.pyc
Binary file not shown.
Binary file removed lib/socket/__pycache__/package.cpython-37.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/socket/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import uuid

from lib.socket.package import *
from version import VERSION


class Client:
Expand Down Expand Up @@ -121,7 +122,7 @@ async def send_message(self, body, message_type):
await self._send_message(len(body), message_type, body)

async def _handshake(self):
data = json.dumps({'client_id': str(self._id), 'client_type': self._client_type}).encode('utf-8')
data = json.dumps({'client_id': str(self._id), 'client_type': self._client_type, 'version': VERSION}).encode('utf-8')
await self._send_message(len(data), HANDSHAKE, data)
self._last_heartbeat_send = datetime.datetime.now()

Expand Down
1 change: 1 addition & 0 deletions version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION = '0.0.1'

0 comments on commit b5ec9c9

Please sign in to comment.