Skip to content

Commit

Permalink
Fix #101. Rename BroadcastTransport to UdpBroadcastTransport.
Browse files Browse the repository at this point in the history
  • Loading branch information
simondelabici committed Jun 21, 2020
1 parent 94d400e commit aaaf272
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/java/org/epics/ca/impl/search/ChannelSearchManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.util.logging.Logger;

import org.epics.ca.Constants;
import org.epics.ca.impl.BroadcastTransport;
import org.epics.ca.impl.UdpBroadcastTransport;
import org.epics.ca.impl.ChannelImpl;
import org.epics.ca.impl.Messages;
import org.epics.ca.util.logging.LibraryLogManager;
Expand Down Expand Up @@ -64,7 +64,7 @@ public class ChannelSearchManager
/**
* Broadcast transport.
*/
private final BroadcastTransport broadcastTransport;
private final UdpBroadcastTransport udpBroadcastTransport;

/**
* Search (datagram) sequence number.
Expand All @@ -83,11 +83,11 @@ public class ChannelSearchManager
/**
* Constructor.
*
* @param broadcastTransport transport
* @param udpBroadcastTransport transport
*/
public ChannelSearchManager( BroadcastTransport broadcastTransport )
public ChannelSearchManager( UdpBroadcastTransport udpBroadcastTransport )
{
this.broadcastTransport = broadcastTransport;
this.udpBroadcastTransport = udpBroadcastTransport;

minSendInterval = MIN_SEND_INTERVAL_MS_DEFAULT;
maxSendInterval = MAX_SEND_INTERVAL_MS_DEFAULT;
Expand Down Expand Up @@ -192,7 +192,7 @@ private void initializeSendBuffer()

// put version message
sequenceNumber.incrementAndGet();
Messages.generateVersionRequestMessage( broadcastTransport, sendBuffer, (short) 0, sequenceNumber.get(), true );
Messages.generateVersionRequestMessage( udpBroadcastTransport, sendBuffer, (short) 0, sequenceNumber.get(), true );
}

/**
Expand All @@ -213,7 +213,7 @@ private synchronized void flushSendBuffer()
immediatePacketCount.set( 0 );
}

broadcastTransport.send( sendBuffer );
udpBroadcastTransport.send( sendBuffer );
initializeSendBuffer();
}

Expand All @@ -226,14 +226,14 @@ private synchronized void flushSendBuffer()
*/
private synchronized boolean generateSearchRequestMessage( ChannelImpl<?> channel, @SuppressWarnings( "SameParameterValue" ) boolean allowNewFrame )
{
boolean success = channel.generateSearchRequestMessage (broadcastTransport, sendBuffer);
boolean success = channel.generateSearchRequestMessage (udpBroadcastTransport, sendBuffer);
// buffer full, flush
if ( !success )
{
flushSendBuffer();
if ( allowNewFrame )
{
channel.generateSearchRequestMessage( broadcastTransport, sendBuffer );
channel.generateSearchRequestMessage( udpBroadcastTransport, sendBuffer );
}
return true;
}
Expand Down

0 comments on commit aaaf272

Please sign in to comment.