timeout of SeedLinkConnection.collect()

Hi all

Q: How do I get SeedLinkConnection.collect() to timeout as indicated to be possible in the online docs

I'm trying to get the obspy seedlink client to timeout but so far no avail. At least according to the documentation of ObsPy it is indicated that this is possible
(see https://docs.obspy.org/packages/autogen/obspy.seedlink.client.seedlinkconnection.SeedLinkConnection.collect.html#obspy.seedlink.client.seedlinkconnection.SeedLinkConnection.collect)

so chances are that I'm simply doing something stupid (ergo any pointers are appreciated)

I've narrowed the problem down as far as possible (hence the code below is only intended to illustrate the problem) to the following script:

#! /usr/bin/env

import sys,time,logging
from obspy.core import UTCDateTime
from obspy.seedlink.slpacket import SLPacket
from obspy.seedlink.client.seedlinkconnection import SeedLinkConnection

logger = logging.getLogger("dummy")
logging.basicConfig(level=logging.DEBUG)
logger.setLevel(logging.DEBUG)

if len(sys.argv) != 2 or sys.argv[1] not in ["pass","hang"]:
    print " usage: python %s <pass|hang>" % (sys.argv[0])
    sys.exit()

slc = SeedLinkConnection(timeout=2)
slc.setSLAddress("rtserver.ipgp.fr:18000")
slc.setBeginTime(UTCDateTime(time.time()-360).formatSeedLink())
if sys.argv[1] == "pass":
    slc.parseStreamlist("G_AIS:BHE",None)
else:
    slc.parseStreamlist("WI_ABD:HHE",None)
slc.collect()
print " --- passed collect()"

If run as with input parameters "pass" all is well (this is implemented to demonstrate that data can be retrieved from the server).
If run with input parameter "hang" the seedlink server will be requested for data not supplied by the server. Naively I would expect for the server to simply return that no data is available which doesn't seem happen so as a backup I would expect (from the documentation) the script to timeout after two seconds which just doesn't happen.

killing the script with ctrl+C indicates that the process hangs at:
   File "[...]/obspy/seedlink/client/seedlinkconnection.py", line 981, in collect
     self.sladdr)
   File "[...]/obspy/seedlink/client/seedlinkconnection.py", line 1218, in receiveData
     bytesread = self.socket.recv(maxbytes)

Indicating that the script is awaiting some message from the server

regP

Dear Obspy-er,
I installed Obspy under Anaconda installation environment. Different tests with example from obspy.org (gallery) website indicate that the installation is correct and Obspy runs well. But, I got an error when I tried to use the module "neries" from Obspy.
Any suggestion and help are appreciated very much.
Kind regards,
Makky

<<<<<<<<<>>>>>>>>>>>>>>>>
Traceback (most recent call last):
  File "query_neries.py", line 3, in <module>
    import obspy.neries
  File "C:\Users\makky_jaya\Anaconda\lib\site-packages\obspy-0.10.2-py2.7-win-amd64.egg\obspy\neries\__init__.py", line 83, in <module>
    from .client import Client # NOQA
  File "C:\Users\makky_jaya\Anaconda\lib\site-packages\obspy-0.10.2-py2.7-win-amd64.egg\obspy\neries\client.py", line 28, in <module>
    from suds.client import Client as SudsClient
ImportError: No module named suds.client

Information in this email and any attachments is confidential and
intended solely for the use of the individual(s) to whom it is addressed
or otherwise directed. Please note that any views or opinions presented
in this email are solely those of the author and do not necessarily
represent those of the Company.
Finally, the recipient should check this email and any attachments for
the presence of viruses. The Company accepts no liability for any damage
caused by any virus transmitted by this email.
All SGS services are rendered in accordance with the applicable SGS
conditions of service available on request and accessible at
http://www.sgs.com/en/Terms-and-Conditions.aspx

Hi Makky,

you also need suds installed for that to work which is an optional dependency of ObsPy.

$ pip install suds-jurko

In the next ObsPy version the obspy.neries package will no longer exist and I think all the web services the old client used to query are no longer available. See https://github.com/obspy/obspy/pull/806

The functionality is superseded by the obspy.fdsn Clients:

http://docs.obspy.org/master/tutorial/code_snippets/retrieving_data_from_datacenters.html

Cheers!

Lion