jboss-netty

long polling netty nio framework java

Hi, How can I do long-polling using netty framework? Say for example I fetch http://localhost/waitforx but waitforx is asynchronous because it has to wait for an event? Say for example it fetches something from a blocking queue(can only fetch when data in queue). When getting item from queue I would like to sent data back to client. Ho...

Closing down a Netty UDP Server

I have a written a very simple UDP Server using Netty - it quite happily binds itself and accepts messages, but I can'y figure out how to unbind it. Am I missing something, or does Netty not expose the necessary APIs to unbind a server? Edit Here is the code I am using to bind the server: DatagramChannelFactory f = new NioDatagramCha...

Bi-directional communication with 1 socket - how to deal with collisions?

Hi, I have one app. that consists of "Manager" and "Worker". Currently, the worker always initiates the connection, says something to the manager, and the manager will send the response. Since there is a LOT of communication between the Manager and the Worker, I'm considering to have a socket open between the two and do the commun...

Java NIO (Netty): Exceptionhandling in Downstream Hanlders/Chain

Hello Experts, could someone please explain to me, how in netty "Downstream Exceptions" are handeled? According to the javadoc there are no Downstream exceptions: http://docs.jboss.org/netty/3.1/api/org/jboss/netty/channel/ExceptionEvent.html Given the case that in one of my downstream handlers an exception occures OR in the I/0 Threa...

Is hosting a Netty Server inside Tomcat feasible/desirable?

We building a Netty/NIO based service, and I'm considering the deployment of this service to our production environment. Our standard way of deploying services is as WARs, to be deployed inside Tomcats. When I suggested the same approach here, I got shouts and complaints that "it shouldn't be done", because both Netty and Tomcat are ser...

How does downstream events work in jboss's netty?

Just started playing around with netty in implementing my own server. Took me a while to get the hang of it but now I was able to accept clients by writing my own MessageHandler and inside messageReceived I was able to read from the buffer and did some business logic related to the data received. However the question now is, how do I w...

Weird indexOutOfBound erro from Netty's ChannelBuffer.read?

I have the following simple code in my netty project, it expects to read an integer from the upstream. No encoder is in the pipeline. public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { ChannelBuffer m = (ChannelBuffer) e.getMessage(); m.readInt() } When the data comes in fro...

What is the meaning of child.connectTimeoutMillis in Netty's configuration?

What does this do in netty? bootstrap.setOption("child.connectTimeoutMillis", x); ...

Proper way to handle async callbacks in Netty with ning client.

Here's my scenario: I've got a custom protocol built on HTTP. I've started a netty server that has two custom handlers after the http ones in the ChannelPipeline: pipeline.addLast("decoder", new HttpRequestDecoder(1024, 10240, 32768)); pipeline.addLast("aggregator", new HttpChunkAggregator(1048576)); pipeline.addLast("encoder", new Http...

Software-Design Issues

Hi, I'm planing to build a software in client-server-design. Technology should be Java. Server should have a communication layer for web-services (e.g. RESTful Jersey), RMI, JSF. Clients can be: Fatclients in Swing or Browser clients in JSF. In my focus are JBoss Netty for the server, Jersey looks much more simple but Netty would have...

Setting socket timeout on netty channel

Hi All I have a netty channel and I would like to set a timeout on the underlying socket ( it is set by default to 0 ). The purpose of the timeout is that the not used channel will be closed if nothing is happening for 15 minutes for instance. Although I dont see any configuration to do so , and the socket itself is also hidden from m...

Using JAVA NIO framework in SPRING server

I'm implementing an hybrid server application that mixes a Web-Servlet and a plain Java application. The java application manages thousands of sockets for remote devices, while the Web application interacts with the user to set/read the state of any socket. Java NIO, or Apache-MINA vs Jboss-Netty, seems to be good options for the socket...

Java netty server getting timed out from client connection

We have a netty server running on a specific tcp port. Once in a while, we are getting time out from client connection at this port. But already connected clients have no problem transferring data in the mean time. What could be the problem and what steps can we take to troubleshoot this? The server has very low cpu/ram usage so I don't ...