Skip to content

Commit

Permalink
Attempt to open the transport only if the socket is not open.
Browse files Browse the repository at this point in the history
Fixes an error where opening the transport would attempt to open a socket
in an already bound address.

Signed-off-by: Victor Araujo <ve.ar91@gmail.com>
  • Loading branch information
vear91 committed Oct 24, 2016
1 parent 761990e commit 2124729
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scribe_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def openConnection(self):


def log(self, category, message):
self.transport.open()
if (not self.transport.isOpen()):
self.transport.open()
message = base64.b64encode(message).strip()
log_entry = scribe.LogEntry(category, message)
result = self.client.Log(messages=[log_entry])
Expand Down

0 comments on commit 2124729

Please sign in to comment.