Giter Club home page Giter Club logo

Comments (8)

romanz avatar romanz commented on June 14, 2024

A bit of background:
I had an issue reported (#6) for Mac OS X last week.
It seemed that there was a problem with some socket system calls on Mac OS X, so I have rewritten the exit logic using polling (instead of calling shutdown() on the listening socket) at fb0d0a5.
However, I have tested this only on my Debian workstation, so I am not sure this fix works on Mac OS.

from trezor-agent.

romanz avatar romanz commented on June 14, 2024

Does the Resource temporarily unavailable error happens all the time?
Does it happen always after the first list_pubs() reply is sent?
What version of SSH client are you using on Mac OS X?

from trezor-agent.

romanz avatar romanz commented on June 14, 2024

An idea: can you tweak server.UNIX_SOCKET_TIMEOUT constant (at https://github.com/romanz/trezor-agent/blob/master/trezor_agent/server.py#L13)?
Currently, it is set 100 ms, but it may be increased to a few seconds to check if it affects the error.

from trezor-agent.

romanz avatar romanz commented on June 14, 2024

It seems that EAGAIN on Mac OS X has errno=35:
http://stackoverflow.com/questions/14595269/errno-35-eagain-returned-on-recv-call

from trezor-agent.

romanz avatar romanz commented on June 14, 2024

If the problem is that the recv() system call is failing with EAGAIN due to a timeout, could you please try the following patch (to make sure that the accepted connection is set to blocking mode) on Mac OS?

diff --git a/trezor_agent/server.py b/trezor_agent/server.py
index 38835fe..a04a3a4 100644
--- a/trezor_agent/server.py
+++ b/trezor_agent/server.py
@@ -63,6 +63,7 @@ def server_thread(server, handler, quit_event):

     def accept_connection():
         conn, _ = server.accept()
+        conn.settimeout(None)
         return conn

     while True:

from trezor-agent.

romanz avatar romanz commented on June 14, 2024

You can also now set the timeout via a command-line argument: b101281

from trezor-agent.

bgok avatar bgok commented on June 14, 2024

@romanz The conn.settimeout(None) fixed it. I tried with both KeepKey and Trezor and they both work.

from trezor-agent.

romanz avatar romanz commented on June 14, 2024

Great!
I will push the fix to master.

from trezor-agent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.