File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
core/pva/src/main/java/org/epics/pva/client Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,9 @@ private class SearchedChannel
146146 /** Buffer for assembling search messages */
147147 private final ByteBuffer send_buffer = ByteBuffer .allocate (PVASettings .MAX_UDP_UNFRAGMENTED_SEND );
148148
149+ /** After header of about 50 bytes, allow this for the search packet payload (CIDs, names) */
150+ private final int MAX_SEARCH_PAYLOAD = PVASettings .MAX_UDP_UNFRAGMENTED_SEND - 50 ;
151+
149152 /** Address list to which search requests are sent */
150153 private final List <AddressInfo > unicast_search_addresses = new ArrayList <>(),
151154 b_or_mcast_search_addresses = new ArrayList <>(),
@@ -345,19 +348,22 @@ private void runSearches()
345348 {
346349 final PVAChannel channel = to_search .get (start + count );
347350 int size = 4 + PVAString .getEncodedSize (channel .getName ());
348- if (payload + size < 50 ) // TODO 1400
351+ if (payload + size < MAX_SEARCH_PAYLOAD )
349352 {
350353 ++count ;
351354 payload += size ;
352355 }
353356 else if (count == 0 )
354- {
357+ { // Can't fit this single name?
355358 logger .log (Level .WARNING , "PV name exceeds search buffer size: " + channel );
356359 searched_channels .remove (channel .getCID ());
357360 to_search .remove (start + count );
358361 }
359362 else
363+ {
364+ logger .log (Level .FINER , () -> "Reached " + MAX_SEARCH_PAYLOAD + " bytes, splitting" );
360365 break ;
366+ }
361367 }
362368 if (count == 0 )
363369 break ;
You can’t perform that action at this time.
0 commit comments