Announcement

Collapse
No announcement yet.

How to stop snapconnect instance

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to stop snapconnect instance

    How to stop snapconnect instance after create it? I look through document and didn't find it.

    The close API is stop_accepting_tcp() but I got errors when it is called in my program. The error information is:
    self.bridge_instance.snap_instance.stop_accepting_ tcp(close_existing=True)
    File "snapconnect\snap.py", line 911, in stop_accepting_tcp
    File "snapconnect\snaptcp.py", line 708, in stop_listening
    File "C:\Python27\Lib\asyncore.py", line 405, in close
    self.socket.close()
    AttributeError: 'NoneType' object has no attribute 'close'


    What is wrong with stop_accepting_tcp and how to stop snapconnect instance? Thanks.

  • #2
    Do you get errors on a consistent basis? Are you taking any other cleanup actions (ex. disconnect_tcp()) before the "stop"?

    You should not have to "Stop" SNAP Connect as whole since it is not really a separate program/process and is only actuated when you use the loop() or poll() APIs.

    You might want to run the poll (or loop) sequence once more after you stop accepting TCP/IP connections in order for it to execute any left-over tasks.

    Another optional action would be to disconnect the serial port.
    sigpic
    Proven Solutions for the Internet of Things
    www.synapse-wireless.com

    Comment

    X