ChannelInitializer.initChannel called multiple times

瀏覽次數:136 次
跳到第一則未讀訊息

john meyer

未讀,
2016年9月20日 中午12:30:192016/9/20
收件者:Netty discussions
I am getting a weird behavior in channel pipeline initializer. when a new connection registered, initChannel() called two times. This is happening only when i am testing client socket connection from firefox browser.


Urgent help needed. what is the reason actually.

Netty version: 4.1.5


Rogan Dawes

未讀,
2016年9月20日 中午12:44:132016/9/20
收件者:Netty discussions
Sound like odd behaviour with Firefox.

Are you using ssl, perhaps?

It might be that ff didn't like your certificate, and aborted, then retried.

Rogan
--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/ab87503f-7383-4c0a-b64d-1b5792307089%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

john meyer

未讀,
2016年9月20日 下午1:04:312016/9/20
收件者:Netty discussions、ro...@dawes.za.net
Thanks Rogan,

It is happening for both non-ssl and ssl.

Norman Maurer

未讀,
2016年9月20日 下午1:09:172016/9/20
收件者:ne...@googlegroups.com
Ensure its actually the same connection. I suspect firefox is opening two connections.

john meyer

未讀,
2016年9月20日 下午1:14:122016/9/20
收件者:Netty discussions
Thanks norman

Here is my pipeline

@Override
public void initChannel(SocketChannel ch) throws Exception 
{
logger.info("=================initChannel===================="+this);
ChannelPipeline pipeline = ch.pipeline();

pipeline.addLast("codec-http", new HttpServerCodec());
pipeline.addLast("deflater", new HttpContentCompressor(1));
pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
pipeline.addLast(CommonExecutors, "websocket-handler", new WebSocketTransport());
訊息已遭刪除

john meyer

未讀,
2016年9月20日 下午1:45:592016/9/20
收件者:Netty discussions


On Tuesday, September 20, 2016 at 11:44:07 PM UTC+6, john meyer wrote:
@Norman

Here is the log. when i am making a socket connection, it is trying to create channel from two different port.

Firefox: 48.0.2


[id: 0xa64b3a8b, L:/xyz.422.190.204:5080 - R:/119.30.38.248:41086]
[id: 0xaf7922c3, L:/xyz.422.190.204:5080 - R:/119.30.38.248:41087]




On Tuesday, September 20, 2016 at 11:09:17 PM UTC+6, Norman Maurer wrote:

Norman Maurer

未讀,
2016年9月20日 下午1:53:222016/9/20
收件者:ne...@googlegroups.com
Yeah this means that firefox opened two connections. So its expected to run initChannel(….) two times. One time per Channel (connection)

john meyer

未讀,
2016年9月20日 下午2:04:452016/9/20
收件者:Netty discussions
the thing is, it is trying for two connection but only a single connection getting active so what can be reason of it ?

Rogan Dawes

未讀,
2016年9月20日 下午2:17:242016/9/20
收件者:Netty discussions
Firefox is closing the connection for some reason, and opening a newer one.

Try logging the data transferred, to see what is happening.

john meyer

未讀,
2016年9月20日 下午2:32:402016/9/20
收件者:Netty discussions、ro...@dawes.za.net
Actually,
 i am not sending any data over socket. i am just creating socket connection.
回覆所有人
回覆作者
轉寄
0 則新訊息