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

Kai Zheng commented on DIRKRB-230:
----------------------------------

Hi Yaning,

Thanks for the taking and good work here! Some comments:
1. Ref. below codes: 1) could we figure out how large the buffer should be for 
typical UDP messages? 2) I thought we should reuse a buffer instead of 
allocating it everytime.
{code}
     private void checkUdpMessage() throws IOException {
-        //TODO
+        ByteBuffer recvBuffer = ByteBuffer.allocate(1024 * 1024);
+        InetSocketAddress fromAddress = (InetSocketAddress) 
udpServer.receive(recvBuffer);
+        if (fromAddress != null) {
+            recvBuffer.flip();
+            KdcUdpTransport transport = transports.get(fromAddress);
+            if (transport == null){
+                transport = new KdcUdpTransport(udpServer, fromAddress);
+            }
+            transport.onRecvMessage(recvBuffer);
+            onNewTransport(transport);
+        }
     }
{code}
2. Maybe we don't use the TransBuffer class and just use a BlockingQueue to 
buffer the received messages?
3. We need a good test to test the new UDP transport really works.

> Support UDP transport for default KdcNetwork
> --------------------------------------------
>
>                 Key: DIRKRB-230
>                 URL: https://issues.apache.org/jira/browse/DIRKRB-230
>             Project: Directory Kerberos
>          Issue Type: Sub-task
>            Reporter: Kai Zheng
>            Assignee: Xu Yaning
>         Attachments: DIRKRB-230-v1.patch
>
>
> This is TODO to be left done.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to