func HandleAeaAddressStream(dhtHandler DHTHandler, stream network.Stream) {
	lerror, _, _, ldebug := dhtHandler.GetLoggers()

	//ldebug().Msg("Got a new aea address stream")

	// get LookupRequest
	streamPipe := utils.StreamPipe{Stream: stream}
	reqAddress, err := acn.ReadLookupRequest(streamPipe)
	if err != nil {
		lerror(err).Str("op", "resolve").
			Msg("while reading message from stream")
		err = stream.Reset()
		ignore(err)
		return
	}

	ldebug().
		Str("op", "resolve").
		Str("target", reqAddress).
		Msg("Received query for addr")

	record, acnError := dhtHandler.HandleAeaAddressRequest(reqAddress)
	if acnError != nil {
		lerror(acnError.Err).
			Str("op", "resolve").
			Str("target", reqAddress).
			Msgf("request address error")
		err = acn.SendAcnError(streamPipe, acnError.Err.Error(), acnError.ErrorCode)
		ignore(err)
		err = stream.Close()
		ignore(err)
		return
	}
	if record == nil {
		lerror(acnError.Err).
			Str("op", "resolve").
			Str("target", reqAddress).
			Msgf("unexpected error. agent record is nil!")
		return
	}
	err = acn.SendLookupResponse(streamPipe, record)
	if err != nil {
		lerror(err).Str("op", "resolve").Str("addr", reqAddress).
			Msg("while sending agent record to peer")
		err = stream.Reset()
		ignore(err)
	}
}
// handle address request stream, handle acn protocol and call dhtHandler.HandleAeaAddressRequest for incoming requests
handle address request stream, handle acn protocol and call dhtHandler.HandleAeaAddressRequest for incoming requests
// handle address request stream handle acn protocol and call dhtHandler . HandleAeaAddressRequest for incoming requests
func HandleAeaAddressStream(dhtHandler DHTHandler, stream network.Stream) {
	lerror, _, _, ldebug := dhtHandler.GetLoggers()
	streamPipe := utils.StreamPipe{Stream: stream}
	reqAddress, err := acn.ReadLookupRequest(streamPipe)
	if err != nil {
		lerror(err).Str("op", "resolve").
			Msg("while reading message from stream")
		err = stream.Reset()
		ignore(err)
		return
	}
	ldebug().
		Str("op", "resolve").
		Str("target", reqAddress).
		Msg("Received query for addr")
	record, acnError := dhtHandler.HandleAeaAddressRequest(reqAddress)
	if acnError != nil {
		lerror(acnError.Err).
			Str("op", "resolve").
			Str("target", reqAddress).
			Msgf("request address error")
		err = acn.SendAcnError(streamPipe, acnError.Err.Error(), acnError.ErrorCode)
		ignore(err)
		err = stream.Close()
		ignore(err)
		return
	}
	if record == nil {
		lerror(acnError.Err).
			Str("op", "resolve").
			Str("target", reqAddress).
			Msgf("unexpected error. agent record is nil!")
		return
	}
	err = acn.SendLookupResponse(streamPipe, record)
	if err != nil {
		lerror(err).Str("op", "resolve").Str("addr", reqAddress).
			Msg("while sending agent record to peer")
		err = stream.Reset()
		ignore(err)
	}
}
func HandleAeaAddressStream ( dhtHandler DHTHandler , stream network . Stream ) { lerror , _ , _ , ldebug := dhtHandler . GetLoggers ( ) streamPipe := utils . StreamPipe { Stream : stream } reqAddress , err := acn . ReadLookupRequest ( streamPipe ) if err != nil { lerror ( err ) . Str ( " " , " " ) . Msg ( " " ) err = stream . Reset ( ) ignore ( err ) return } ldebug ( ) . Str ( " " , " " ) . Str ( " " , reqAddress ) . Msg ( " " ) record , acnError := dhtHandler . HandleAeaAddressRequest ( reqAddress ) if acnError != nil { lerror ( acnError . Err ) . Str ( " " , " " ) . Str ( " " , reqAddress ) . Msgf ( " " ) err = acn . SendAcnError ( streamPipe , acnError . Err . Error ( ) , acnError . ErrorCode ) ignore ( err ) err = stream . Close ( ) ignore ( err ) return } if record == nil { lerror ( acnError . Err ) . Str ( " " , " " ) . Str ( " " , reqAddress ) . Msgf ( " " ) return } err = acn . SendLookupResponse ( streamPipe , record ) if err != nil { lerror ( err ) . Str ( " " , " " ) . Str ( " " , reqAddress ) . Msg ( " " ) err = stream . Reset ( ) ignore ( err ) } }
handle address request stream, handle acn protocol and call dhtHandler.HandleAeaAddressRequest for incoming requests
handle address request stream handle acn protocol and call dhtHandler . HandleAeaAddressRequest for incoming requests
//ldebug().Msg("Got a new aea address stream") // get LookupRequest