Re: miivi - dht probe

From: Stefan Kaczmarek <stefan_at_thezonie.org>
Date: Fri, 18 May 2007 14:29:59 -0700

Ok, it's in the latest app now.

On May 18, 2007, at 11:45 AM, Ty Heath wrote:

> Here is the code I use to send a hello request to a client:
>
> ByteBufferWrapper request(hello_req_buffer,sizeof
> (hello_req_buffer)); //create an object that wraps a byte*, for
> easy, safe and readable i/o
>
> request.WriteByte(0xe9); //dht protocol
> request.WriteByte(0x55); //opcode - DHT_HELLO_REQ
>
> request.WriteBytes(fake_user_hash,16); //Pick a random hash to
> put here, but make it constant (don't do a different random hash to
> every client you talk to)
> request.WriteDWord(m_my_ip); //your ip, this field can be any
> value because the peer just uses the source ip of the packet.
> request.WriteWord(DHTPORT); //whatever port you are listening on
> request.WriteWord(DHTPORT); //whatever port you are listening
> on, always the same as the previous word, because wasting bandwidth
> is cool.
> request.WriteByte(0); //NULL byte on the end for no apparent
> reason, because wasting bandwidth is cool.
>
> this->SendTo(request.GetLength(),request.GetMutableBufferPtr
> (),contact.m_ip,contact.m_port);
>
>
>
Received on Fri Sep 14 2007 - 10:55:59 BST

This archive was generated by hypermail 2.2.0 : Sun Sep 16 2007 - 22:19:47 BST