I am not sure if this is the same issue I am having but apparently I am also using atmosphere for web sockets and make it work in embedded tomcat.
I looked at the tomcat unit tests for bio connector and the tests are not doing anything special. They set the address to localhost. I tried the below code similar to the unit tests but I still can't connect to tomcat when I use this connector. Connector nioConnector = new Connector(Http11NioProtocol.class.getName()); nioConnector.setPort(TOMCAT_PORT); nioConnector.setProperty("address", InetAddress.getByName("localhost").getHostAddress()); tomcat.setConnector(nioConnector); Unit test I saw is here: http://svn.apache.org/repos/asf/tomcat/trunk/test/org/apache/catalina/nonbl ocking/TestNonBlockingAPI.java And http://svn.apache.org/repos/asf/tomcat/trunk/test/org/apache/catalina/start up/TomcatBaseTest.java Thanks Praveen On 4/23/13 Apr 23, 10:40 AM, "Tribon Cheng" <tribon1...@gmail.com> wrote: >Just like this issue: > >http://atmosphere-framework.2306103.n4.nabble.com/WebSocket-not-working-on >-Tomcat-7-With-NIO-connector-was-WebSocket-not-working-on-Tomcat-7-td46523 >51.html > > >On Tue, Apr 23, 2013 at 10:16 PM, Mark Thomas <ma...@apache.org> wrote: > >> On 23/04/2013 15:11, Praveen Peddi wrote: >> > Hi all, I am trying to set Nio connector in tomcat7 so I can use >> > WebSocket support. I did the following (as simple as it can get) but >> > it doesn't seem to work. When I do this I can't connect to the >> > server. For example I have a GET REST request that should work but I >> > get connection refused. Same with WebSocket request. >> > >> > >> > Connector nioConnector = new Connector(); >> > >> > nioConnector.setPort(TOMCAT_PORT); >> > >> > nioConnector.setProtocol(Http11NioProtocol.class.getName()); >> > >> > tomcat.setConnector(nioConnector); >> > >> > >> > If I comment out above lines and use default Http connector, REST >> > requests work fine but WebSockets are not supported with default http >> > connector. >> >> Yes they are. >> >> > So I am wondering if anyone has enabled bio connector in >> > embedded tomcat before. I am using embedded tomcat 7.0.34. >> >> You mean NIO right? >> >> Look at the source code for the unit tests and/or the source code for >> Connector. You aren't changing what you think you are changing. (Too >> many attributes call Protocol or something similar). >> >> Mark >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> > > >-- >Contribute to Enterprise Integration --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org