Skip to content

Commit

Permalink
Merge pull request OpenLiberty#14 from isaacrivriv/fix-netty-wsat-fats
Browse files Browse the repository at this point in the history
Added fix for virtual host difference between chfw and netty
  • Loading branch information
isaacrivriv authored Apr 12, 2024
2 parents aa8fb66 + a01cb4f commit 803cc36
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ public synchronized void startNettyChannel() {
cancelToken.set(false);

channelFuture = nettyFramework.start(bootstrap, info.getHost(), info.getPort(), this::channelFutureHandler, cancelToken);

VirtualHostMap.notifyStarted(owner, () -> currentConfig.getResolvedHost(), currentConfig.getConfigPort(), isHttps);
String topic = owner.getEventTopic() + HttpServiceConstants.ENDPOINT_STARTED;
postEvent(topic, currentConfig, null);


//channelFuture.get(10, TimeUnit.SECONDS);
Expand All @@ -299,13 +303,14 @@ public synchronized void startNettyChannel() {
private void channelFutureHandler(ChannelFuture future) {
if(future.isSuccess()) {
serverChannel = future.channel();
state.set(ChainState.STARTED);

MSP.log("Channel is now active and listening on port " + getActivePort());
VirtualHostMap.notifyStarted(owner, () -> currentConfig.getResolvedHost(), currentConfig.getConfigPort(), isHttps);
String topic = owner.getEventTopic() + HttpServiceConstants.ENDPOINT_STARTED;
postEvent(topic, currentConfig, null);
// VirtualHostMap.notifyStarted(owner, () -> currentConfig.getResolvedHost(), currentConfig.getConfigPort(), isHttps);
// String topic = owner.getEventTopic() + HttpServiceConstants.ENDPOINT_STARTED;
// postEvent(topic, currentConfig, null);

state.set(ChainState.STARTED);
// state.set(ChainState.STARTED);

} else {
MSP.log("ChannelFutureHandler -> Failed to bind to port: " + future.cause());
Expand Down

0 comments on commit 803cc36

Please sign in to comment.