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

Georgi Goranov commented on DIRKRB-608:
---------------------------------------

Note that Socket( hostName, portNo) uses infinite timeout as default value 
which might be critical in some cases.

> KerberosChannel.timeout has no effect
> -------------------------------------
>
>                 Key: DIRKRB-608
>                 URL: https://issues.apache.org/jira/browse/DIRKRB-608
>             Project: Directory Kerberos
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M23
>            Reporter: Georgi Goranov
>              Labels: performance
>
> protected void openConnection( String hostName, int  portNo, int timeOut, 
> boolean isUdp ) throws IOException
>     {
>         this.useUdp = isUdp;
>         this.timeOut = timeOut;
>         
>         if ( isUdp )
>         {
>             udpServerAddr = new InetSocketAddress( hostName, portNo );
>             udpSocket = new DatagramSocket();
>         }
>         else
>         {
>             tcpSocket = new Socket( hostName, portNo );
>             tcpSocket.setSoTimeout( ( int ) timeOut );
>             in = new DataInputStream( tcpSocket.getInputStream() );
>             out = tcpSocket.getOutputStream();
>         }
>     }
> Socket is created and an attempt to establish connection is made at line 
> tcpSocket = new Socket( hostName, portNo );
> but  after that changing timeout is done ( tcpSocket.setSoTimeout( ( int 
> )timeOut ); )
> Potential fix:
> tcpSocket = new Socket( );
> tcpSocket.connect( hostname,portNo, timeout );



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

Reply via email to