You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Stefano Bagnara (JIRA)" <ji...@apache.org> on 2007/05/18 22:17:16 UTC

[jira] Created: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
----------------------------------------------------------

                 Key: DIRMINA-379
                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
             Project: MINA
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.1.0, 1.0.3, 2.0.0-M1
         Environment: Windows Vista Home Premium Italian
Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
            Reporter: Stefano Bagnara


When I ran my application under Vista I get this exception:

Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
	at sun.nio.ch.Net.setIntOption0(Native Method)
	at sun.nio.ch.Net.setIntOption(Net.java:152)
	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
	... 7 more

I had to remove the following lines from the SocketSessionImpl constructor:
this.config.setKeepAlive( cfg.isKeepAlive() );
this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
and now it works.

No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Barry Kaplan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765602#action_12765602 ] 

Barry Kaplan commented on DIRMINA-379:
--------------------------------------

Is there any workaround for this with the 1.1.7 ??

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592533#action_12592533 ] 

Stefano Bagnara commented on DIRMINA-379:
-----------------------------------------

I tried adding isOpen and isConnected output to the exception by altering the SocketSessionImpl.setKeepAlive (mina 1.1.8-SNAPSHOT) this way:
        public void setKeepAlive(boolean on) {
        		boolean isConnected = ch.isConnected();
        		boolean isOpen = ch.isOpen();
            try {
           	  	ch.socket().setKeepAlive(on);
            } catch (SocketException e) {
                throw new RuntimeIOException("setKeepAlive error isOpen: "+isOpen+"/"+ch.isOpen()+" isConnected: "+isConnected+"/"+ch.isConnected(), e);
            }
        }

The result is this exception:

1513 [AnonymousIoService-8] WARN org.apache.mina.common.support.DefaultExceptionMonitor - Unexpected exception.
org.apache.mina.common.RuntimeIOException: setKeepAlive error isOpen: true/true isConnected: true/true
	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:238)
	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:101)
	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:341)
	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:295)
	at org.apache.mina.transport.socket.nio.SocketConnector.access$800(SocketConnector.java:53)
	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:383)
	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
	at sun.nio.ch.Net.setIntOption0(Native Method)
	at sun.nio.ch.Net.setIntOption(Net.java:154)
	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:406)
	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
	at sun.nio.ch.SocketOptsImpl$IP$TCP.keepAlive(SocketOptsImpl.java:268)
	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:236)
	... 7 more

So the channel is OPEN and CONNECTED.

Furthermore I logged the exception from the MINA test failure:

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.043 sec
Running org.apache.mina.transport.socket.nio.SocketBindTest
9357 [SocketAcceptor-8] WARN org.apache.mina.common.support.DefaultExceptionMonitor - Unexpected exception.
org.apache.mina.common.RuntimeIOException: setKeepAlive error isOpen: true/true
isConnected: true/true
        at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:238)
        at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:101)
        at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.processSessions(SocketAcceptor.java:283)
        at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.java:225)
        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
        at sun.nio.ch.Net.setIntOption0(Native Method)
        at sun.nio.ch.Net.setIntOption(Net.java:154)
        at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:406)
        at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
        at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
        at sun.nio.ch.SocketOptsImpl$IP$TCP.keepAlive(SocketOptsImpl.java:268)
        at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
        at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
        at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:236)
        ... 5 more
Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.677 sec <<< FAILURE!

Tests in error:
  testUnbindDisconnectsClients(org.apache.mina.transport.socket.nio.SocketBindTest)

The fact that also the mina test also fails from time to time let me hope that this is not an issue in my code!

I also tried to alter the order of the setkeepAlive/setReuseAddress as suggested by Daniel Wirtz in the previous comment but it didn't fix the issue in my app: I still get the same very exception on the setKeepAlive. The only difference is that I get the exception few seconds later.

Unfortunately I'm not able to create a small test that always fail. The good news (or bad??) is that my application fails 100% of the runs.

I'm not sure I understand Alan message: is he saying that we have to report this to bugs.sun.com and that we cannot do anything to fix this in MINA? Isn't any workaround we can use to temporarily solve this issue?


> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592132#action_12592132 ] 

Stefano Bagnara commented on DIRMINA-379:
-----------------------------------------

I checked out the latest 1.1 branch (1.1.8-SNAPSHOT).
The first time I ran the tests SocketBindTest failed with the usuale setInt exception.
Then I've never been able to reproduce that failure in mina tests.

My application still show the issue so I changed the order of the setReuseAddress and setKeepAlive, but my application still failed. So I also added a check on the keepAlive to call the setter only when the value is really changed and now I don't see the issue anymore.

Here is the patch I'm using:

Index: mina-core-1.1/src/main/java/org/apache/mina/transport/socket/nio/SocketSessionImpl.java
===================================================================
--- mina-core-1.1/src/main/java/org/apache/mina/transport/socket/nio/SocketSessionImpl.java	(revision 651305)
+++ mina-core-1.1/src/main/java/org/apache/mina/transport/socket/nio/SocketSessionImpl.java	(working copy)
@@ -98,10 +98,10 @@
         IoSessionConfig sessionConfig = serviceConfig.getSessionConfig();
         if (sessionConfig instanceof SocketSessionConfig) {
             SocketSessionConfig cfg = (SocketSessionConfig) sessionConfig;
+            this.config.setReuseAddress(cfg.isReuseAddress());
             this.config.setKeepAlive(cfg.isKeepAlive());
             this.config.setOobInline(cfg.isOobInline());
             this.config.setReceiveBufferSize(cfg.getReceiveBufferSize());
-            this.config.setReuseAddress(cfg.isReuseAddress());
             this.config.setSendBufferSize(cfg.getSendBufferSize());
             this.config.setSoLinger(cfg.getSoLinger());
             this.config.setTcpNoDelay(cfg.isTcpNoDelay());
@@ -229,7 +229,9 @@
 
         public void setKeepAlive(boolean on) {
             try {
-                ch.socket().setKeepAlive(on);
+            	  if (ch.socket().getKeepAlive() != on) {
+            	  	ch.socket().setKeepAlive(on);
+            	  }
             } catch (SocketException e) {
                 throw new RuntimeIOException(e);
             }


I'll do more tests as soon as I find the time for them.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596600#action_12596600 ] 

Trustin Lee commented on DIRMINA-379:
-------------------------------------

It's a Windows-only issue according to Alan.  I forgot the exact reason, but it's due to the recent changes in Windows networking stack.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trustin Lee resolved DIRMINA-379.
---------------------------------

    Resolution: Cannot Reproduce
      Assignee: Trustin Lee

Can't reproduce in my Windows Vista.  Please try to upgrade your JDK.  If it still doesn't work with the latest build, please reopen.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592149#action_12592149 ] 

Stefano Bagnara commented on DIRMINA-379:
-----------------------------------------

My patch above didn't fix the issue. 
Now I get the same exception on the getKeepAlive:

2974 [SocketConnector-0] WARN org.apache.mina.common.support.DefaultExceptionMonitor - Unexpected exception.
org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:238)
	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:102)
	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:341)
	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:295)
	at org.apache.mina.transport.socket.nio.SocketConnector.access$800(SocketConnector.java:53)
	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:383)
	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
	at sun.nio.ch.Net.getIntOption0(Native Method)
	at sun.nio.ch.Net.getIntOption(Net.java:143)
	at sun.nio.ch.SocketChannelImpl$1.getInt(SocketChannelImpl.java:401)
	at sun.nio.ch.SocketOptsImpl.getBoolean(SocketOptsImpl.java:34)
	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:88)
	at sun.nio.ch.SocketOptsImpl$IP$TCP.keepAlive(SocketOptsImpl.java:268)
	at sun.nio.ch.OptionAdaptor.getKeepAlive(OptionAdaptor.java:147)
	at sun.nio.ch.SocketAdaptor.getKeepAlive(SocketAdaptor.java:326)
	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:234)
	... 7 more

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596796#action_12596796 ] 

Trustin Lee commented on DIRMINA-379:
-------------------------------------

Stefano, you are using MINA 1.x, right?  MINA 2 has optimized the system calls related with socket parameters for fater initialization, so it shouldn't have this issue unless you changed any socket parameters.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Daniel Wirtz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592104#action_12592104 ] 

vcdaniel edited comment on DIRMINA-379 at 4/24/08 9:05 AM:
---------------------------------------------------------------

Yes, I think this could be the reason. I tried the following now:

            this.connector = new NioSocketConnector(thread_pool, new NioProcessor(thread_pool));
            this.connector.getSessionConfig().setReuseAddress(true);
            etc.

The exception is still thrown, so maybe the Mina SessionConfigImpl used in org.apache.mina.transport.socket.nio.NioSocketSession internally does not set ReuseAddress before KeepAlive as mentioned in the description you added. Maybe changing the internal order can fix it. I also suggest setting ReuseAddress by default to true, if it is not yet the default behaviour.

----

I took a look. The problem is located

in
org.apache.mina.transport.socket.AbstractSocketSessionConfig$doSetAll
called by
org.apache.mina.common.AbstractIoSessionConfig$setAll
of course inherited by
org.apache.mina.transport.socket.nio.NioSocketSession$SocketConfigImpl

            setKeepAlive(cfg.isKeepAlive());
            setOobInline(cfg.isOobInline());
            setReceiveBufferSize(cfg.getReceiveBufferSize());
            setReuseAddress(cfg.isReuseAddress());
            setSendBufferSize(cfg.getSendBufferSize());
            setSoLinger(cfg.getSoLinger());
            setTcpNoDelay(cfg.isTcpNoDelay());

in conjunction with

            private static boolean DEFAULT_REUSE_ADDRESS = false;

in
org.apache.mina.transport.socket.DefaultSocketSessionConfig

      was (Author: vcdaniel):
    Yes, I think this could be the reason. I tried the following now:

            this.connector = new NioSocketConnector(thread_pool, new NioProcessor(thread_pool));
            this.connector.getSessionConfig().setReuseAddress(true);
            etc.

The exception is still thrown, so maybe the Mina SessionConfigImpl used in org.apache.mina.transport.socket.nio.NioSocketSession internally does not set ReuseAddress before KeepAlive as mentioned in the description you added. Maybe changing the internal order can fix it. I also suggest setting ReuseAddress by default to true, if it is not yet the default behaviour.
  
> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Daniel Wirtz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592104#action_12592104 ] 

Daniel Wirtz commented on DIRMINA-379:
--------------------------------------

Yes, I think this could be the reason. I tried the following now:

            this.connector = new NioSocketConnector(thread_pool, new NioProcessor(thread_pool));
            this.connector.getSessionConfig().setReuseAddress(true);
            etc.

The exception is still thrown, so maybe the Mina SessionConfigImpl used in org.apache.mina.transport.socket.nio.NioSocketSession internally does not set ReuseAddress before KeepAlive as mentioned in the description you added. Maybe changing the internal order can fix it. I also suggest setting ReuseAddress by default to true, if it is not yet the default behaviour.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497021 ] 

Stefano Bagnara commented on DIRMINA-379:
-----------------------------------------

The only similar issue I found on the internet searching for my exception is this: HTTPCORE-29
Maybe the comments to that issue make sense to some of you :-) even if it is not MINA related it anyway something related to the reactor pattern on nio and setTcpNoDelay call.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara reopened DIRMINA-379:
-------------------------------------


Updated to jdk6 update 6 and now I see it more rarely, but after some run I saw the same exception a couple of times.
I don't know if this could be something wrong I do with mina and threads because I'm not a mina expert, but the same code in XP and linux works.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRMINA-379:
--------------------------------------


Is there anything we can do before 2.0-RC1 ?

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596596#action_12596596 ] 

Trustin Lee commented on DIRMINA-379:
-------------------------------------

I met Alan Bateman, the NIO.2 lead, and he told me that there's no clean solution for this issue for now.  Probably we should close the connection when we fail to configure the socket in Windows?  NIO.2 will fix this issue though.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498121 ] 

Trustin Lee commented on DIRMINA-379:
-------------------------------------

I don't understand why these two sentences are causing the socket exception.  I don't have vista installed yet.  Let me test as soon as possible.  

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Mauritz Lovgren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mauritz Lovgren updated DIRMINA-379:
------------------------------------

    Comment: was deleted

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Daniel Wirtz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592088#action_12592088 ] 

Daniel Wirtz commented on DIRMINA-379:
--------------------------------------

Fully updated Windows Vista, JRE 1.6.0_06 and it is still there:

org.apache.mina.common.RuntimeIoException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
        at org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setKeepAlive(NioSocketSession.java:146)
        at org.apache.mina.transport.socket.AbstractSocketSessionConfig.doSetAll(AbstractSocketSessionConfig.java:39)
        at org.apache.mina.common.AbstractIoSessionConfig.setAll(AbstractIoSessionConfig.java:59)
        at org.apache.mina.transport.socket.nio.NioSocketSession.<init>(NioSocketSession.java:77)
        at org.apache.mina.transport.socket.nio.NioSocketConnector.newSession(NioSocketConnector.java:154)
        at org.apache.mina.transport.socket.nio.NioSocketConnector.newSession(NioSocketConnector.java:45)
        at org.apache.mina.common.AbstractPollingIoConnector.processSessions(AbstractPollingIoConnector.java:255)
        at org.apache.mina.common.AbstractPollingIoConnector.access$500(AbstractPollingIoConnector.java:41)
        at org.apache.mina.common.AbstractPollingIoConnector$Worker.run(AbstractPollingIoConnector.java:299)
        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
        at sun.nio.ch.Net.setIntOption0(Native Method)
        at sun.nio.ch.Net.setIntOption(Net.java:154)
        at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:406)
        at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
        at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
        at sun.nio.ch.SocketOptsImpl$IP$TCP.keepAlive(SocketOptsImpl.java:268)
        at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
        at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
        at org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setKeepAlive(NioSocketSession.java:144)
        ... 12 more

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596681#action_12596681 ] 

Stefano Bagnara commented on DIRMINA-379:
-----------------------------------------

I see it in a Vista box, never saw it Linux Windows XP.

The *weird* thing is that if I remove any call to keepAlive, reuseAddress and tcpNoDelay the application works fine without exception and at full speed under vista!!

I hope mina can do something to make my app working in Vista without having to run my own "hacked" mina version. Unfortunately I don't really have the needed skills (network knowledge) to provide a good patch (my patch simply remove all the set/get for the above properties).

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592171#action_12592171 ] 

Emmanuel Lecharny commented on DIRMINA-379:
-------------------------------------------

Tanks guys !

Seems that we are progressing in the good direction :)

FYI, generating a diff is just as simple as typing this command :

svn diff > diff.txt

You have to be on the root of the MINA source directory (ie, if you did a svn co http://svn...(blah)/mina/trunk mina-2.0.0-M1, you have to be into mina-2.0.0-M1 directory to pass the command, so that the complete path will be stored into the diff file).

Thanks !

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802257#action_12802257 ] 

Julien Vermillard commented on DIRMINA-379:
-------------------------------------------

is it still a problem with 2.0.0 RC1 ?

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Sangjin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596598#action_12596598 ] 

Sangjin Lee commented on DIRMINA-379:
-------------------------------------

I also see this issue on Windows 2003 Server...  Which makes me curious.  Is this a cross-platform issue or specific to some flavors of Windows?  From Alan B's comments, it sounds like a generic issue with these methods?

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592097#action_12592097 ] 

Emmanuel Lecharny commented on DIRMINA-379:
-------------------------------------------

May it be connected to this description : ?

http://communitygrids.blogspot.com/2007/09/windows-vista-sockets-java-nio-and.html

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592332#action_12592332 ] 

Trustin Lee commented on DIRMINA-379:
-------------------------------------

A message from Alan Bateman:

Trustin,

I had a mail yesterday from someone that asked me to comment on this issue:
 https://issues.apache.org/jira/browse/DIRMINA-379

I don't have a login on that site so I cannot reply but I see you are "Assignee" so I figured I would mail you.

A long standing issue with the socket adapters is that they aren't synchronized with the closing of the channel. In order words, if you invoke methods on the Socket obtained from the socket channel's socket method then it does not throw an exception to indicate that the socket is closed. The typical error will be an "Invalid argument" error but it can vary by platform. For Windows Vista it will typically be an error to say the handle isn't a socket. We have replaced this code as part of the implementation of NIO2 so it will not be an issue in the future. I can't say for sure that your issue 379 is the same thing but if you can duplicate the problem easily then it would be great if you test if the channel is open or closed by invoking the isOpen method. If its closed that will explain the issue. If the channel is open then it may be an issue we haven't seen before, in which case it would be great if you could forward it to bugs.sun.com.

Thanks,

Alan.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Mauritz Lovgren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642875#action_12642875 ] 

Mauritz Lovgren commented on DIRMINA-379:
-----------------------------------------

I see this as well (Windows 2000, 2003 Server and Vista), but only when reusing one SocketConnector for many client sessions, connecting clients very quickly in sequence.

If I create a new SocketConnector instance for every client connection, the problem goes away. If this is due to the overhead of creating a new SocketConnector for each client, I do not know. I imagined one SocketConnector was multi-thread safe for creating many client connections in parallell (ref. the connectQueue etc ..) ?

For the record, using MINA 1.1.7. Am a bit reluctant to go for MINA 2 in our production environment since it is not stable yet...

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trustin Lee reassigned DIRMINA-379:
-----------------------------------

    Assignee:     (was: Trustin Lee)

Too busy right now.  Someone please fix it.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Daniel Wirtz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592065#action_12592065 ] 

Daniel Wirtz commented on DIRMINA-379:
--------------------------------------

I can confirm this bug under Windows Vista with JRE 1.6.0 Update 3. As far as I know it is caused by the JRE, not Mina. I'll try upgrading to Update 5 and check if it still exist.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Daniel Wirtz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592152#action_12592152 ] 

Daniel Wirtz commented on DIRMINA-379:
--------------------------------------

For 2.0.0-M1 the fix is:

Change

    private static boolean DEFAULT_REUSE_ADDRESS = false;

to

    private static boolean DEFAULT_REUSE_ADDRESS = true;

in socket.DefaultSocketSessionConfig

And change

    setKeepAlive(cfg.isKeepAlive());
    setOobInline(cfg.isOobInline());
    setReceiveBufferSize(cfg.getReceiveBufferSize());
    setReuseAddress(cfg.isReuseAddress());

to

    setReuseAddress(cfg.isReuseAddress());
    setKeepAlive(cfg.isKeepAlive());
    setOobInline(cfg.isOobInline());
    setReceiveBufferSize(cfg.getReceiveBufferSize());

in socket.AbstractSocketSessionConfig

Seems to work as far as I can tell. Unfortunately I'm neigher familar with the 1.x branch nor with diff but maybe you can create a patch accordingly. The change applied to the default reuse behaviour is required, because the default values are set before anyone is able to override them inside the NioSessionConfig constructor.

> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (DIRMINA-379) setKeepAlive/setTcpNoDelay and exceptions in Windows Vista

Posted by "Daniel Wirtz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592152#action_12592152 ] 

vcdaniel edited comment on DIRMINA-379 at 4/24/08 12:11 PM:
----------------------------------------------------------------

For 2.0.0-M1 the fix is:

Change

    private static boolean DEFAULT_REUSE_ADDRESS = false;

to

    private static boolean DEFAULT_REUSE_ADDRESS = true;

in socket.DefaultSocketSessionConfig

And change

    setKeepAlive(cfg.isKeepAlive());
    setOobInline(cfg.isOobInline());
    setReceiveBufferSize(cfg.getReceiveBufferSize());
    setReuseAddress(cfg.isReuseAddress());

to

    setReuseAddress(cfg.isReuseAddress());
    setKeepAlive(cfg.isKeepAlive());
    setOobInline(cfg.isOobInline());
    setReceiveBufferSize(cfg.getReceiveBufferSize());

in socket.AbstractSocketSessionConfig

Seems to work as far as I can tell. Unfortunately I'm neigher familar with the 1.x branch nor with diff but maybe you can create a patch accordingly. The change applied to the default reuse behaviour is required, because the default values are set before anyone is able to override them inside the NioSessionConfig constructor.

Edit: Oh, just looked around the sources again: I may be wrong with the default setting. But without changing it, the same app will work on xp/linux but not on vista without setting ReuseAddress explicitly.

      was (Author: vcdaniel):
    For 2.0.0-M1 the fix is:

Change

    private static boolean DEFAULT_REUSE_ADDRESS = false;

to

    private static boolean DEFAULT_REUSE_ADDRESS = true;

in socket.DefaultSocketSessionConfig

And change

    setKeepAlive(cfg.isKeepAlive());
    setOobInline(cfg.isOobInline());
    setReceiveBufferSize(cfg.getReceiveBufferSize());
    setReuseAddress(cfg.isReuseAddress());

to

    setReuseAddress(cfg.isReuseAddress());
    setKeepAlive(cfg.isKeepAlive());
    setOobInline(cfg.isOobInline());
    setReceiveBufferSize(cfg.getReceiveBufferSize());

in socket.AbstractSocketSessionConfig

Seems to work as far as I can tell. Unfortunately I'm neigher familar with the 1.x branch nor with diff but maybe you can create a patch accordingly. The change applied to the default reuse behaviour is required, because the default values are set before anyone is able to override them inside the NioSessionConfig constructor.
  
> setKeepAlive/setTcpNoDelay and exceptions in Windows Vista
> ----------------------------------------------------------
>
>                 Key: DIRMINA-379
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-379
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3, 1.1.0, 2.0.0-M1
>         Environment: Windows Vista Home Premium Italian
> Java SE 1.5.0_11, Java SE 1.6 Update 1, Java SE 1.4.2_12
>            Reporter: Stefano Bagnara
>            Assignee: Trustin Lee
>
> When I ran my application under Vista I get this exception:
> Exception in thread "Thread-4" org.apache.mina.common.RuntimeIOException: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:252)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl.<init>(SocketSessionImpl.java:94)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.newSession(SocketConnector.java:350)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:290)
> 	at org.apache.mina.transport.socket.nio.SocketConnector.access$900(SocketConnector.java:53)
> 	at org.apache.mina.transport.socket.nio.SocketConnector$Worker.run(SocketConnector.java:395)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:152)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl.keepAlive(SocketOptsImpl.java:92)
> 	at sun.nio.ch.OptionAdaptor.setKeepAlive(OptionAdaptor.java:139)
> 	at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:322)
> 	at org.apache.mina.transport.socket.nio.SocketSessionImpl$SessionConfigImpl.setKeepAlive(SocketSessionImpl.java:248)
> 	... 7 more
> I had to remove the following lines from the SocketSessionImpl constructor:
> this.config.setKeepAlive( cfg.isKeepAlive() );
> this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
> and now it works.
> No matter if I change the configuration to let them return true or false, I keep getting the exception if I don't remove the call at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.