MCPcopy Create free account
hub / github.com/ShareDropio/sharedrop / _onPeerDCOutgoingConnection

Function _onPeerDCOutgoingConnection

app/controllers/index.js:134–147  ·  view source on GitHub ↗
(event, data)

Source from the content-addressed store, hash-verified

132 },
133
134 _onPeerDCOutgoingConnection(event, data) {
135 const { connection } = data;
136 const peers = this.model;
137 const peer = peers.findBy('peer.id', connection.peer);
138 const file = peer.get('transfer.file');
139 const { webrtc } = this;
140 const info = webrtc.getFileInfo(file);
141
142 peer.set('peer.state', 'connected');
143 peer.set('state', 'awaiting_response');
144
145 webrtc.sendFileInfo(connection, info);
146 console.log('Sending a file info...', info);
147 },
148
149 _onPeerDCOutgoingConnectionError(event, data) {
150 const { connection, error } = data;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected