func ReceiveRouteFromDestination(db *DB, token string) *Route {

	//Read the first part of the header
	headerBytes := make([]byte, 4+10+8)
	_, err := db.getDestConn(token).conn.Read(headerBytes)
	if err != nil {
		log.Println(err)
	}

	//Read the number of hops
	numberHopsBytes := make([]byte, 2)
	numberHops := binary.LittleEndian.Uint16(numberHopsBytes)

	//Read the rest of the route
	hopsBytes := make([]byte, numberHops*4)
	_, err = db.getDestConn(token).conn.Read(hopsBytes)
	if err != nil {
		log.Println(err)
	}

	routeBytes := append(headerBytes, numberHopsBytes...)
	routeBytes = append(routeBytes, hopsBytes...)

	closeDestConnection(db, token)

	return deserializeRoute(routeBytes)
}
//ReceiveRouteFromDestination waits on a connection
ReceiveRouteFromDestination waits on a connection
// ReceiveRouteFromDestination waits on a connection
func ReceiveRouteFromDestination(db *DB, token string) *Route {
	headerBytes := make([]byte, 4+10+8)
	_, err := db.getDestConn(token).conn.Read(headerBytes)
	if err != nil {
		log.Println(err)
	}
	numberHopsBytes := make([]byte, 2)
	numberHops := binary.LittleEndian.Uint16(numberHopsBytes)
	hopsBytes := make([]byte, numberHops*4)
	_, err = db.getDestConn(token).conn.Read(hopsBytes)
	if err != nil {
		log.Println(err)
	}
	routeBytes := append(headerBytes, numberHopsBytes...)
	routeBytes = append(routeBytes, hopsBytes...)
	closeDestConnection(db, token)
	return deserializeRoute(routeBytes)
}
func ReceiveRouteFromDestination ( db * DB , token string ) * Route { headerBytes := make ( [ ] byte , 4 + 10 + 8 ) _ , err := db . getDestConn ( token ) . conn . Read ( headerBytes ) if err != nil { log . Println ( err ) } numberHopsBytes := make ( [ ] byte , 2 ) numberHops := binary . LittleEndian . Uint16 ( numberHopsBytes ) hopsBytes := make ( [ ] byte , numberHops * 4 ) _ , err = db . getDestConn ( token ) . conn . Read ( hopsBytes ) if err != nil { log . Println ( err ) } routeBytes := append ( headerBytes , numberHopsBytes ... ) routeBytes = append ( routeBytes , hopsBytes ... ) closeDestConnection ( db , token ) return deserializeRoute ( routeBytes ) }
ReceiveRouteFromDestination waits on a connection
ReceiveRouteFromDestination waits on a connection
//Read the first part of the header //Read the number of hops //Read the rest of the route