Skip to content

Bootstrap refactor - #594

Merged
normanmaurer merged 5 commits into
masterfrom
bootstrap_refactor
Sep 13, 2012
Merged

normanmaurer merged 5 commits into
masterfrom
bootstrap_refactor

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

I refactored the bootstrap code to make it easier to reuse Bootstraps.

It's now for example possible to call for example ClientBootstreap.connect() multiple times and get a new Channel at each call.

This was motivated by #591

@trustin @fredericBregier wdyt ?

…eate new Clientbootstrap instances from an existing one
@fredericBregier

Copy link
Copy Markdown
Member

Just to ensure you have my comments:

Yes I test it and it works.
One thing however, but more to understand than a real issue is that when I made some logs, I found out that INACTIVE and UNREGISTERED event occur after the closeFuture().sync(). It might be just an issue of concurrency and nothing to do with something wrong. But I just want to ensure it is fine, and specially in this case where someone just reconnect using the same ClientBootstrap. Again, no issue during my test, so it might be a false question... ;-)

@normanmaurer

Copy link
Copy Markdown
Member Author

One think that I'm not sure with is the name "ClientBootstrap" as its used on both sides of UDP. Any better suggestions ?

@fredericBregier

Copy link
Copy Markdown
Member

Hmm, not so a specialist of UDP, but it is at least consistent with Netty 3...
So I believe it is ok at least in term of consistency.

Now, from Java API, you're right that Socket are names DatagramSocket, with no difference whatever client or server. As the bootstrap is shared for both UDP and TCP in particular, I don't see another name for that that will be consistent.
Except if one specify : AbstractBootstrap for the main implementation :

public abstract class Bootstrap<B extends Bootstrap<?>>

giving something as

public abstract class AbstractBootstrap<B extends AbstractBootstrap<?>>

and then keeping ServerBootstrap and Bootstrap as previously ?
But is it more clear ? I don't know...

@normanmaurer

Copy link
Copy Markdown
Member Author

Yeah maybe the best ;)

2012/9/12 Frédéric Brégier [email protected]

Hmm, not so a specialist of UDP, but it is at least consistent with Netty
3...
So I believe it is ok at least in term of consistency.

Now, from Java API, you're right that Socket are names DatagramSocket,
with no difference whatever client or server. As the bootstrap is shared
for both UDP and TCP in particular, I don't see another name for that that
will be consistent.
Except if one specify : AbstractBootstrap for the main implementation :

public abstract class Bootstrap<B extends Bootstrap<?>>

giving something as

public abstract class AbstractBootstrap<B extends AbstractBootstrap<?>>

and then keeping ServerBootstrap and Bootstrap as previously ?
But is it more clear ? I don't know...

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/594#issuecomment-8483413.

@fredericBregier

Copy link
Copy Markdown
Member

I read also your other comment on ConnectionlessBootstrap from Netty 3. You see now why I say I'm not used to UDP ;-)

Now, as I am not enough aware of Netty 4 and in particular UDP support, is it the same than ClientBootstrap or is it another one in Netty 4?

If it is not the same, then using the same name than in Netty3 will probably help more the user (in particular from 3 to 4 move). But if they are the same, I see 2 options there:

  1. Keeping Bootstrap as the unique name but then using AbstractBootstrap for the "general abstract class"
  2. Extending without "real" extension ClientBootstrap to ConnectionlessBootstrap...

Again, from my "user" point of view, I would say that keeping if possible some "name" consistency could help migration. On the other end, if the semantic is different, keeping the name could also introduce some bad understanding... So my thoughts are not "gold", but just some thoughts...

@normanmaurer

Copy link
Copy Markdown
Member Author

@fredericBregier about the UNREGISTERED and CLOSED events.. This is correct as the futures are always notfied before the event is triggered. Its even the same for other operations like bind().. etc

@fredericBregier

Copy link
Copy Markdown
Member

Thanks @normanmaurer !
I understand. It was more a way to ensure I understand than an issue as you understood.

@normanmaurer

Copy link
Copy Markdown
Member Author

@fredericBregier no problem.. I really appreciate your feedback/review

normanmaurer added a commit that referenced this pull request Sep 13, 2012
@normanmaurer
normanmaurer merged commit ded98dd into master Sep 13, 2012
chrisvest pushed a commit to chrisvest/netty that referenced this pull request Apr 2, 2025
Motivation:

The name of the config param changed when we updated the version

Modifications:

Use correct name

Result:

Release works again on window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants