[ 
https://issues.apache.org/jira/browse/GOSSIP-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995594#comment-15995594
 ] 

ASF GitHub Bot commented on GOSSIP-85:
--------------------------------------

Github user gdusbabek commented on a diff in the pull request:

    https://github.com/apache/incubator-gossip/pull/50#discussion_r114643992
  
    --- Diff: 
gossip-transport-udp/src/main/java/org/apache/gossip/transport/udp/UdpTransportManager.java
 ---
    @@ -58,10 +62,35 @@ public UdpTransportManager(GossipManager gossipManager, 
GossipCore gossipCore) {
           LOGGER.warn(ex);
           throw new RuntimeException(ex);
         }
    +    me = new Thread(this);
       }
     
       @Override
    +  public void run() {
    +    while (keepRunning.get()) {
    +      try {
    +        byte[] buf = read();
    +        try {
    +          Base message = gossipManager.getProtocolManager().read(buf);
    +          gossipCore.receive(message);
    +          //TODO this is suspect
    +          gossipManager.getMemberStateRefresher().run();
    +        } catch (RuntimeException ex) {//TODO trap json exception
    +          LOGGER.error("Unable to process message", ex);
    +        }
    +      } catch (IOException e) {
    +        // InterruptedException are completely normal here because of the 
blocking lifecycle.
    +        if (!(e.getCause() instanceof InterruptedException)) {
    +          LOGGER.error(e);
    +        }
    +        keepRunning.set(false);
    +      }
    +    }
    +  }
    +  
    +  @Override
       public void shutdown() {
    +    keepRunning.set(false);
    --- End diff --
    
    Is there a need to interrupt the thread here?


> UDP Server moved to sub module
> ------------------------------
>
>                 Key: GOSSIP-85
>                 URL: https://issues.apache.org/jira/browse/GOSSIP-85
>             Project: Gossip
>          Issue Type: Improvement
>            Reporter: Edward Capriolo
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to