소스 검색

Added a better comment as to why we have to check
the channels even though the negative channels would
pass through as the default channels just fine.
The key is avoiding UDP calls... they will get
translated into a regular send.

Paul Speed 10 년 전
부모
커밋
58313c271d
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      jme3-networking/src/main/java/com/jme3/network/service/rpc/RpcConnection.java

+ 7 - 2
jme3-networking/src/main/java/com/jme3/network/service/rpc/RpcConnection.java

@@ -115,8 +115,13 @@ public class RpcConnection {
  
         if( log.isLoggable(Level.FINEST) ) {
             log.log(Level.FINEST, "Sending:{0}  on channel:{1}", new Object[]{msg, channel});
-        }        
-        if( channel >= 0 ) {
+        }
+        
+        // Prevent non-async messages from being send as UDP
+        // because there is a high probabilty that this would block
+        // forever waiting for a response.  For async calls it's ok
+        // so it doesn't do the check.
+        if( channel >= 0 ) {        
             connection.send(channel, msg);
         } else {
             connection.send(msg);