All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.rsocket.util.ConnectionUtils Maven / Gradle / Ivy

There is a newer version: 1.1.4
Show newest version
package io.rsocket.util;

import io.netty.buffer.ByteBufAllocator;
import io.rsocket.frame.ErrorFrameFlyweight;
import io.rsocket.internal.ClientServerInputMultiplexer;
import reactor.core.publisher.Mono;

public class ConnectionUtils {

  public static Mono sendError(
      ByteBufAllocator allocator, ClientServerInputMultiplexer multiplexer, Exception exception) {
    return multiplexer
        .asSetupConnection()
        .sendOne(ErrorFrameFlyweight.encode(allocator, 0, exception))
        .onErrorResume(err -> Mono.empty());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy