Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7183345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:57:39+00:00 2026-05-28T17:57:39+00:00

I have two systems I’d like to integrate, one which uses a completely in-house

  • 0

I have two systems I’d like to integrate, one which uses a completely in-house networking stack, and one (specifically Flazr) which uses Netty. I want to proxy the Flazr Netty-based RTMP stream over our in-house HTTP stack, to yield a system that speaks RTMPT.

To accomplish this, I need a Netty object that acts like a socket, but lets me do all of the “low-level” stuff myself – basically just wrapping the data in HTTP and passing it down our custom networking stack. In other words, I don’t want Netty to manage any sockets for me – I want to insert my own stuff between the socket and Netty.

I suspect that the right way to go about this is to extend AbstractServerChannel and create a *Factory class, but I’m uncertain as to how the rest of Netty expects data to be flowing through the ServerChannel.

My custom ServerChannel need to be able to:

  • Notify Netty when a new client connects via our existing HTTP system

  • Push data up to Netty, when it arrives

  • Poll for new messages from Netty, at the request of a client

  • Clean up Netty state when the HTTP session times out (or the RTMP stream is closed cleanly)

Any pointers on how ServerChannel, ServerChannelFactory are to be implemented? I found the javadocs rather lacking in this area.

Some specific questions:

  • How should my implementation respond to “InterestOps”-type stuff?

  • Is ServerChannel.write what is called for messages that come all the way down the stack? What’s up with the two different overloads?

  • How do I need to implement ServerChannel.(dis)connect?

  • Should I still do all of this stuff through ServerBootstrap, or is that too high-level for this stuff?

Thanks!

Before anyone asks: YES, I would love to replace our custom networking stack with a Netty-based one, but that’s a large engineering task that I’d have a hard time justifying. Baby steps.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:57:40+00:00Added an answer on May 28, 2026 at 5:57 pm

    Its look like, you are trying to implement a new asynchronous transport, so it will be worth to have a look on NIO TCP transport (other than Datagram classes).

    I am not sure how relevant it is, but it will help to understand how to write a new transport service for Netty (since you have asked about Server, Client Channels, Factories, and all)

    It will be easier If you can understand the Netty event model and how goes through the pipeline. This is my understanding about how it works.

    • Upstream events (event from network) starts from Channel/ServerChannel, Boss/NioWorker and send through the pipeline until it reaches the last handler.

    • Downstream events starts from last downstream handler and send through the pipeline and sinks at ChannelSink, channel sink process the events and take action or put the messages on channel’s queues.

    In more details, (I assume, some one is looking on Nio TCP transport classes to write their custom transport for Netty).

    NioWorker
    – On selector events for the channels (all NioClientSocketChannel, NioAcceptedSocketChannel), runs the nio loop
    – Data received from network: fire message received
    – Poll write queue and does non blocking write
    – Poll task queue for interested op events and take suspend/resume the channel?.

    Boss

    • Runs Server NIO event loop.
    • Accept client socket, creates a NioAcceptedSocketChannel, and register selectors for NioWorker

    NioClientSocketPipelineSink

    • Has a worker thread pool executor.
    • Submit NioWorker runnables to worker thread pool at constructor.
    • Client channel downstream events sinks here and put to channels write queue/task queue, intercept some upstream state events and manages the state of the channel.

    NioServerSocketPipelineSink

    • Has boss thread pool.
    • Submit Nio worker runnables to executor at creation.
    • Submit boss runnable with ServerSocketChannel to executor on bind event.
    • Server channel downstream events sinks here, intercept some upstream state events and manages ServerSocketChannel state.

    How should my implementation respond to “InterestOps”-type stuff?

    It depends on the nature of the channel (blocking/non blocking) and constrains.

    Is ServerChannel.write what is called for messages that come all the way down the stack? What’s up with the two different overloads?

    Server channel has no need to support those method calls, I think you are referring to Channel’s

    ChannelFuture write(Object message);
    
    ChannelFuture write(Object message, SocketAddress remoteAddress);
    

    These methods are there for connectionless transport. For TCP, both are actually doing the same thing.

    How do I need to implement ServerChannel.(dis)connect?

    Server channel doesn’t need to support those method calls, but you should implement, bind and unbind here.

    Should I still do all of this stuff through ServerBootstrap, or is that too high-level for this stuff?

    Server/client bootstraps are just helper classes to manage pipeline resources and provide a facade to bind, connect & disconnect. You have to implement most of the logic in

    Client, Server Channel Impls
    Client, Server Pipeline sinks
    Boss, Worker classes,

    Then you have to implement client & server channel factories using above classes, if these things are done, you can simply setup you server & client using Bootstrap classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two systems I'm trying to integrate. One is built on raw servlets,
I have two Slackware Linux systems on which the POSIX semaphore sem_open() call fails
I have two systems to integrate: 1)desktop application (Java6) and 2)web-application (HTML,JS). I want
We have two systems, one based on JMS and another based on WebSphere MQ.
I have two different systems one with OpenGL 1.4 and one with 3. My
We have two systems: external and internal, which are sharing information in JSON format
I have two virtual systems for development. First one is Windows + xampp (apache,
I have two arrays of System.Data.DataRow objects which I want to compare. The rows
In my system I have two different projects, one defining its interfaces and another
I have two tables that were built for two disparate systems. I have records

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.