MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / connect

Method connect

src/fileSystem/ftp.js:56–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 }
55
56 connect() {
57 return new Promise((resolve, reject) => {
58 ftp.connect(
59 this.#host,
60 +this.#port,
61 this.#username,
62 this.#password,
63 {
64 securityType: this.#security,
65 connectionMode: this.#mode,
66 encoding: settings.value.defaultFileEncoding,
67 },
68 (conId) => {
69 this.#conId = conId;
70 resolve();
71 },
72 (err) => {
73 if (settings.value.retryRemoteFsAfterFail) {
74 if (++this.#try > this.#MAX_TRY) {
75 this.#try = 0;
76 reject(err);
77 return;
78 }
79 this.connect().then(resolve).catch(reject);
80 } else {
81 reject(err);
82 }
83 },
84 );
85 });
86 }
87
88 setPath(val) {
89 this.#path = val;

Callers 1

Calls 2

resolveFunction · 0.85
connectMethod · 0.65

Tested by

no test coverage detected