use of org.apache.beam.vendor.grpc.v1p43p2.io.netty.channel.unix.DomainSocketAddress in project netty by netty.
the class EpollServerDomainSocketChannel method doClose.
@Override
protected void doClose() throws Exception {
try {
super.doClose();
} finally {
DomainSocketAddress local = this.local;
if (local != null) {
// Delete the socket file if possible.
File socketFile = new File(local.path());
boolean success = socketFile.delete();
if (!success && logger.isDebugEnabled()) {
logger.debug("Failed to delete a domain socket file: {}", local.path());
}
}
}
}
use of org.apache.beam.vendor.grpc.v1p43p2.io.netty.channel.unix.DomainSocketAddress in project netty by netty.
the class KQueueServerDomainSocketChannel method doClose.
@Override
protected void doClose() throws Exception {
try {
super.doClose();
} finally {
DomainSocketAddress local = this.local;
if (local != null) {
// Delete the socket file if possible.
File socketFile = new File(local.path());
boolean success = socketFile.delete();
if (!success && logger.isDebugEnabled()) {
logger.debug("Failed to delete a domain socket file: {}", local.path());
}
}
}
}
use of org.apache.beam.vendor.grpc.v1p43p2.io.netty.channel.unix.DomainSocketAddress in project zuul by Netflix.
the class SocketAddressPropertyTest method bindTypeWorks_uds.
@Test
public void bindTypeWorks_uds() {
SocketAddress address = SocketAddressProperty.Decoder.INSTANCE.apply("UDS=/var/run/zuul.sock");
assertEquals(DomainSocketAddress.class, address.getClass());
DomainSocketAddress domainSocketAddress = (DomainSocketAddress) address;
assertEquals("/var/run/zuul.sock", domainSocketAddress.path());
}
use of org.apache.beam.vendor.grpc.v1p43p2.io.netty.channel.unix.DomainSocketAddress in project reactor-netty by reactor.
the class NewConnectionProvider method acquire.
@Override
public Mono<? extends Connection> acquire(TransportConfig config, ConnectionObserver observer, @Nullable Supplier<? extends SocketAddress> remoteAddress, @Nullable AddressResolverGroup<?> resolverGroup) {
return Mono.create(sink -> {
SocketAddress remote = null;
if (remoteAddress != null) {
remote = Objects.requireNonNull(remoteAddress.get(), "Remote Address supplier returned null");
}
ConnectionObserver connectionObserver = new NewConnectionObserver(sink, observer);
DisposableConnect disposableConnect = new DisposableConnect(sink, config.bindAddress());
if (remote != null && resolverGroup != null) {
ChannelInitializer<Channel> channelInitializer = config.channelInitializer(connectionObserver, remote, false);
TransportConnector.connect(config, remote, resolverGroup, channelInitializer).subscribe(disposableConnect);
} else {
Objects.requireNonNull(config.bindAddress(), "bindAddress");
SocketAddress local = Objects.requireNonNull(config.bindAddress().get(), "Bind Address supplier returned null");
if (local instanceof InetSocketAddress) {
InetSocketAddress localInet = (InetSocketAddress) local;
if (localInet.isUnresolved()) {
local = AddressUtils.createResolved(localInet.getHostName(), localInet.getPort());
}
}
ChannelInitializer<Channel> channelInitializer = config.channelInitializer(connectionObserver, null, true);
TransportConnector.bind(config, channelInitializer, local, local instanceof DomainSocketAddress).subscribe(disposableConnect);
}
});
}
use of org.apache.beam.vendor.grpc.v1p43p2.io.netty.channel.unix.DomainSocketAddress in project reactor-netty by reactor.
the class UriEndpoint method toExternalForm.
String toExternalForm() {
StringBuilder sb = new StringBuilder();
SocketAddress address = remoteAddress.get();
if (address instanceof DomainSocketAddress) {
sb.append(((DomainSocketAddress) address).path());
} else {
sb.append(scheme);
sb.append("://");
sb.append(address != null ? toSocketAddressStringWithoutDefaultPort(address, isSecure()) : "localhost");
sb.append(pathAndQuery);
}
return sb.toString();
}
Aggregations