Giter VIP home page Giter VIP logo

Comments (6)

jbenet avatar jbenet commented on May 26, 2024

wooow:

func SendCommand(command *Command, server string) error {
    conn, err := net.DialTimeout("tcp", server, time.Millisecond*300)
        ...
}

I'm apparently good at cli response time.

I think TRTTD here would be to -- instead of trying a random server -- see if there is a local server open by having a $configdir/lock file. possible names:

.go-ipfs/lock
.go-ipfs/daemon
.go-ipfs/rpcaddr

Its content can be a multiaddr with the socket to use to talk to the daemon rpc endpoint:

# unix domain socket
/unix/Users/jbenet/.go-ipfs/ipfs.sock

# or tcp
/ip6/127.0.0.1/tcp/4001 

bradfitz already did the heavy lifting of making a portable lock file lib: https://github.com/camlistore/lock

from kubo.

whyrusleeping avatar whyrusleeping commented on May 26, 2024

Im really impressed at your latency guess... Ill switch over to using a lockfile for daemon connections!

from kubo.

whyrusleeping avatar whyrusleeping commented on May 26, 2024

So, the camlistore lock library doesnt allow you to put and file content in the lock file itself. Im thinking we could have the lock file, and another file nearby that contains the daemon addr to connect to

from kubo.

jbenet avatar jbenet commented on May 26, 2024

Hmm wonder why it is. But yeah can use another file or a config value. (Writing one small file and writing the config are pretty much equiv).—
Sent from Mailbox

On Sat, Sep 20, 2014 at 2:12 PM, Jeromy Johnson [email protected]
wrote:

So, the camlistore lock library doesnt allow you to put and file content in the lock file itself. Im thinking we could have the lock file, and another file nearby that contains the daemon addr to connect to

Reply to this email directly or view it on GitHub:
#94 (comment)

from kubo.

whyrusleeping avatar whyrusleeping commented on May 26, 2024

Ugh... i wish the camlistore lock library had defined error types, it makes it difficult to differentiate between "Bad path to file!" and "Lock already exists!"... i may fork it

from kubo.

whyrusleeping avatar whyrusleeping commented on May 26, 2024

I beleive this has been solved and merged in...

from kubo.

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.