From d920fddf1521d9fedfeec4836b5cc8202324228a Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Tue, 17 Sep 2013 20:26:10 +0200 Subject: [PATCH] Increase buffer size even more when binary querying connections --- .../de/schildbach/pte/AbstractHafasProvider.java | 2 +- .../schildbach/pte/live/NvvProviderLiveTest.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/enabler/src/de/schildbach/pte/AbstractHafasProvider.java b/enabler/src/de/schildbach/pte/AbstractHafasProvider.java index 43bf09d5..0147d09e 100644 --- a/enabler/src/de/schildbach/pte/AbstractHafasProvider.java +++ b/enabler/src/de/schildbach/pte/AbstractHafasProvider.java @@ -1556,7 +1556,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider { } - private final static int QUERY_TRIPS_BINARY_BUFFER_SIZE = 128 * 1024; + private final static int QUERY_TRIPS_BINARY_BUFFER_SIZE = 192 * 1024; protected final QueryTripsResult queryTripsBinary(Location from, Location via, Location to, final Date date, final boolean dep, final int numTrips, final Collection products, final WalkSpeed walkSpeed, final Accessibility accessibility, diff --git a/enabler/test/de/schildbach/pte/live/NvvProviderLiveTest.java b/enabler/test/de/schildbach/pte/live/NvvProviderLiveTest.java index 9b356711..2e1f950e 100644 --- a/enabler/test/de/schildbach/pte/live/NvvProviderLiveTest.java +++ b/enabler/test/de/schildbach/pte/live/NvvProviderLiveTest.java @@ -20,6 +20,7 @@ package de.schildbach.pte.live; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import java.io.IOException; import java.util.Date; import java.util.List; @@ -214,4 +215,19 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest LocationType.ANY, 0, null, "Frankfurt Hauptbahnhof!"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL); System.out.println(result); } + + @Test + public void tripUsingMuchBuffer() throws IOException + { + final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, 0, 50119563, 8697044, null, + "Hegelstrasse, 60316 Frankfurt am Main"), null, new Location(LocationType.ADDRESS, 0, 50100364, 8615193, null, + "Mainzer Landstrasse, Frankfurt"), new Date(1378368840000l), true, Product.ALL, null, null); + System.out.println(result); + + if (!result.context.canQueryLater()) + return; + + final QueryTripsResult laterResult = queryMoreTrips(result.context, true); + System.out.println(laterResult); + } }