From b7714af3df6fe48ded645edab2fcfe1481fb8a59 Mon Sep 17 00:00:00 2001 From: "E. Joshua Rigler" <erigler@usgs.gov> Date: Mon, 23 Nov 2020 18:47:31 -0700 Subject: [PATCH] Fix small bugs in MiniSeedInputClient.py Also, fixed controller's get_output_factory to initialize the MiniSeedFactory class when --ouput is miniseed --- geomagio/Controller.py | 2 +- geomagio/edge/MiniSeedInputClient.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/geomagio/Controller.py b/geomagio/Controller.py index 7111ef576..3305ecb68 100644 --- a/geomagio/Controller.py +++ b/geomagio/Controller.py @@ -424,7 +424,7 @@ def get_output_factory(args): elif output_type == "miniseed": # TODO: deal with other miniseed arguments locationcode = args.outlocationcode or args.locationcode or None - output_factory = edge.EdgeFactory( + output_factory = edge.MiniSeedFactory( host=args.output_host, port=args.output_read_port, write_port=args.output_port, diff --git a/geomagio/edge/MiniSeedInputClient.py b/geomagio/edge/MiniSeedInputClient.py index 906c37e32..0e6a20728 100644 --- a/geomagio/edge/MiniSeedInputClient.py +++ b/geomagio/edge/MiniSeedInputClient.py @@ -48,7 +48,7 @@ class MiniSeedInputClient(object): attempts += 1 try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.connect(self.host, self.port) + s.connect((self.host, self.port)) break except socket.error as e: if attempts >= max_attempts: @@ -73,4 +73,4 @@ class MiniSeedInputClient(object): buf = io.BytesIO() stream.write(buf, format="MSEED") # send data - self.socket.sendall(buf) + self.socket.sendall(buf.read()) -- GitLab