Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting odd error. #12

Closed
FLYBYME opened this issue Oct 22, 2015 · 2 comments
Closed

Getting odd error. #12

FLYBYME opened this issue Oct 22, 2015 · 2 comments
Labels

Comments

@FLYBYME
Copy link

FLYBYME commented Oct 22, 2015

Im playing around with the code but keep getting this error when i tell utorrent to connect.

192.168.1.10:2432
  bittorrent-protocol [6b84ad93] new wire +0ms
  bittorrent-protocol [6b84ad93] end +19s
  bittorrent-protocol [6b84ad93] got uninterested +1ms
  bittorrent-protocol [6b84ad93] got choke +1ms
destroy (error: socket close)
  bittorrent-protocol [6b84ad93] destroy +1ms
  bittorrent-protocol [6b84ad93] end +1ms
  bittorrent-protocol [6b84ad93] got uninterested +0ms
  bittorrent-protocol [6b84ad93] got choke +1ms
192.168.1.10:2435
  bittorrent-protocol [570342ee] new wire +41s
  bittorrent-protocol [570342ee] Error: wire not speaking BitTorrent protocol (♥??Q"!U??↨w~▬=0Kr???K??,??w??O#\h??*-??3??
?‼D+►p??-LW??A`?m${?,??I??????a??I
????Z?????\?a??g?B♦q???/??????p??????↑♣???3??E?y??????????G?!J??♥??F?_C??1?w???%??►L?vK???''\7????;?\z?`♂_) +2ms
  bittorrent-protocol [570342ee] end +1ms
  bittorrent-protocol [570342ee] got uninterested +0ms
  bittorrent-protocol [570342ee] got choke +1ms
destroy (error: socket close)
  bittorrent-protocol [570342ee] destroy +5ms
  bittorrent-protocol [570342ee] end +1ms
  bittorrent-protocol [570342ee] got uninterested +0ms
  bittorrent-protocol [570342ee] got choke +1ms

@FLYBYME
Copy link
Author

FLYBYME commented Oct 22, 2015

This is the code im running.

//192.168.1.101:9879
var dhtPort = 20001
var serverPort = 9879

var Protocol = require('bittorrent-protocol')
var net = require('net')

net.createServer(function(socket) {
    var wire = new Protocol()

    // pipe to and from the protocol
    socket.pipe(wire).pipe(socket)

    wire.on('handshake', function(infoHash, peerId) {
    console.log('handshake')
    })

    wire.on('unchoke', function() {
        console.log('peer is no longer choking us: ' + wire.peerChoking)
    })
}).listen(serverPort);

The client im using is utorrent 2.2

More error:

bittorrent-protocol [7cfa097b] new wire +0ms
bittorrent-protocol [7cfa097b] Error: wire not speaking BitTorrent protocol (?!??♂??→?↨ ????§????m▬.¶??E;↨?&?♠?       "?_♫z??R????DU?]???h???♣►☼?♠??
.?}??$?@?Zv?8???V???_??IJ???§↑?5?u'?-{↑???y??.B????`??♣?e???kF2???l???k?c??k??L[?- A?1>??;6??2?[♂5?
?e??SC?5?∟?☺??n?
B?Fb????) +204ms
bittorrent-protocol [7cfa097b] end +4ms
bittorrent-protocol [7cfa097b] got uninterested +0ms
bittorrent-protocol [7cfa097b] got choke +1ms
bittorrent-protocol [e8e24ae6] new wire +48s
&It?↔F↓??B?|??I?↔?♂?n#U?R)?u?↨?F|? ) +2mse not speaking BitTorrent protocol (?????
bittorrent-protocol [e8e24ae6] end +1ms
bittorrent-protocol [e8e24ae6] got uninterested +0ms
bittorrent-protocol [e8e24ae6] got choke +1ms
``

@feross
Copy link
Member

feross commented Feb 11, 2016

When you get the 'handshake' event, you need to immediately respond with a wire.handshake() back.

wire.on('handshake', function(infoHash, peerId) {
  wire.handshake(infoHash, myPeerId)
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants