Path: blob/master/src/java.base/share/classes/sun/nio/ch/Net.java
41159 views
/*1* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.nio.ch;2627import java.io.FileDescriptor;28import java.io.IOException;29import java.net.Inet4Address;30import java.net.Inet6Address;31import java.net.InetAddress;32import java.net.InetSocketAddress;33import java.net.NetworkInterface;34import java.net.ProtocolFamily;35import java.net.SocketAddress;36import java.net.SocketException;37import java.net.SocketOption;38import java.net.StandardProtocolFamily;39import java.net.StandardSocketOptions;40import java.net.UnknownHostException;41import java.nio.channels.AlreadyBoundException;42import java.nio.channels.ClosedChannelException;43import java.nio.channels.NotYetBoundException;44import java.nio.channels.NotYetConnectedException;45import java.nio.channels.UnresolvedAddressException;46import java.nio.channels.UnsupportedAddressTypeException;47import java.security.AccessController;48import java.security.PrivilegedAction;49import java.util.Enumeration;5051import sun.net.ext.ExtendedSocketOptions;52import sun.net.util.IPAddressUtil;53import sun.security.action.GetPropertyAction;5455public class Net {5657private Net() { }5859// unspecified protocol family60static final ProtocolFamily UNSPEC = new ProtocolFamily() {61public String name() {62return "UNSPEC";63}64};6566// set to true if exclusive binding is on for Windows67private static final boolean exclusiveBind;6869// set to true if the fast tcp loopback should be enabled on Windows70private static final boolean fastLoopback;7172// -- Miscellaneous utilities --7374private static volatile boolean checkedIPv6;75private static volatile boolean isIPv6Available;76private static volatile boolean checkedReusePort;77private static volatile boolean isReusePortAvailable;7879/**80* Tells whether dual-IPv4/IPv6 sockets should be used.81*/82static boolean isIPv6Available() {83if (!checkedIPv6) {84isIPv6Available = isIPv6Available0();85checkedIPv6 = true;86}87return isIPv6Available;88}8990/**91* Tells whether SO_REUSEPORT is supported.92*/93static boolean isReusePortAvailable() {94if (!checkedReusePort) {95isReusePortAvailable = isReusePortAvailable0();96checkedReusePort = true;97}98return isReusePortAvailable;99}100101/**102* Returns true if exclusive binding is on103*/104static boolean useExclusiveBind() {105return exclusiveBind;106}107108/**109* Tells whether both IPV6_XXX and IP_XXX socket options should be set on110* IPv6 sockets. On some kernels, both IPV6_XXX and IP_XXX socket options111* need to be set so that the settings are effective for IPv4 multicast112* datagrams sent using the socket.113*/114static boolean shouldSetBothIPv4AndIPv6Options() {115return shouldSetBothIPv4AndIPv6Options0();116}117118/**119* Tells whether IPv6 sockets can join IPv4 multicast groups120*/121static boolean canIPv6SocketJoinIPv4Group() {122return canIPv6SocketJoinIPv4Group0();123}124125/**126* Tells whether {@link #join6} can be used to join an IPv4127* multicast group (IPv4 group as IPv4-mapped IPv6 address)128*/129static boolean canJoin6WithIPv4Group() {130return canJoin6WithIPv4Group0();131}132133/**134* Tells whether IPV6_XXX socket options should be used on an IPv6 socket135* that is bound to an IPv4 address.136*/137static boolean canUseIPv6OptionsWithIPv4LocalAddress() {138return canUseIPv6OptionsWithIPv4LocalAddress0();139}140141public static InetSocketAddress checkAddress(SocketAddress sa) {142if (sa == null)143throw new NullPointerException();144if (!(sa instanceof InetSocketAddress))145throw new UnsupportedAddressTypeException(); // ## needs arg146InetSocketAddress isa = (InetSocketAddress)sa;147if (isa.isUnresolved())148throw new UnresolvedAddressException(); // ## needs arg149InetAddress addr = isa.getAddress();150if (!(addr instanceof Inet4Address || addr instanceof Inet6Address))151throw new IllegalArgumentException("Invalid address type");152return isa;153}154155static InetSocketAddress checkAddress(SocketAddress sa, ProtocolFamily family) {156InetSocketAddress isa = checkAddress(sa);157if (family == StandardProtocolFamily.INET) {158InetAddress addr = isa.getAddress();159if (!(addr instanceof Inet4Address))160throw new UnsupportedAddressTypeException();161}162return isa;163}164165static InetSocketAddress asInetSocketAddress(SocketAddress sa) {166if (!(sa instanceof InetSocketAddress))167throw new UnsupportedAddressTypeException();168return (InetSocketAddress)sa;169}170171static void translateToSocketException(Exception x)172throws SocketException173{174if (x instanceof SocketException)175throw (SocketException)x;176Exception nx = x;177if (x instanceof ClosedChannelException)178nx = new SocketException("Socket is closed");179else if (x instanceof NotYetConnectedException)180nx = new SocketException("Socket is not connected");181else if (x instanceof AlreadyBoundException)182nx = new SocketException("Already bound");183else if (x instanceof NotYetBoundException)184nx = new SocketException("Socket is not bound yet");185else if (x instanceof UnsupportedAddressTypeException)186nx = new SocketException("Unsupported address type");187else if (x instanceof UnresolvedAddressException)188nx = new SocketException("Unresolved address");189else if (x instanceof IOException) {190nx = new SocketException(x.getMessage());191}192if (nx != x)193nx.initCause(x);194195if (nx instanceof SocketException)196throw (SocketException)nx;197else if (nx instanceof RuntimeException)198throw (RuntimeException)nx;199else200throw new Error("Untranslated exception", nx);201}202203static void translateException(Exception x,204boolean unknownHostForUnresolved)205throws IOException206{207if (x instanceof IOException)208throw (IOException)x;209// Throw UnknownHostException from here since it cannot210// be thrown as a SocketException211if (unknownHostForUnresolved &&212(x instanceof UnresolvedAddressException))213{214throw new UnknownHostException();215}216translateToSocketException(x);217}218219static void translateException(Exception x)220throws IOException221{222translateException(x, false);223}224225/**226* Returns the local address after performing a SecurityManager#checkConnect.227*/228static InetSocketAddress getRevealedLocalAddress(SocketAddress sa) {229InetSocketAddress isa = (InetSocketAddress) sa;230@SuppressWarnings("removal")231SecurityManager sm = System.getSecurityManager();232if (isa != null && sm != null) {233try {234sm.checkConnect(isa.getAddress().getHostAddress(), -1);235} catch (SecurityException e) {236// Return loopback address only if security check fails237isa = getLoopbackAddress(isa.getPort());238}239}240return isa;241}242243@SuppressWarnings("removal")244static String getRevealedLocalAddressAsString(SocketAddress sa) {245InetSocketAddress isa = (InetSocketAddress) sa;246if (System.getSecurityManager() == null) {247return isa.toString();248} else {249return getLoopbackAddress(isa.getPort()).toString();250}251}252253private static InetSocketAddress getLoopbackAddress(int port) {254return new InetSocketAddress(InetAddress.getLoopbackAddress(), port);255}256257private static final InetAddress anyLocalInet4Address;258private static final InetAddress anyLocalInet6Address;259private static final InetAddress inet4LoopbackAddress;260private static final InetAddress inet6LoopbackAddress;261static {262try {263anyLocalInet4Address = inet4FromInt(0);264assert anyLocalInet4Address instanceof Inet4Address265&& anyLocalInet4Address.isAnyLocalAddress();266267anyLocalInet6Address = InetAddress.getByAddress(new byte[16]);268assert anyLocalInet6Address instanceof Inet6Address269&& anyLocalInet6Address.isAnyLocalAddress();270271inet4LoopbackAddress = inet4FromInt(0x7f000001);272assert inet4LoopbackAddress instanceof Inet4Address273&& inet4LoopbackAddress.isLoopbackAddress();274275byte[] bytes = new byte[16];276bytes[15] = 0x01;277inet6LoopbackAddress = InetAddress.getByAddress(bytes);278assert inet6LoopbackAddress instanceof Inet6Address279&& inet6LoopbackAddress.isLoopbackAddress();280} catch (Exception e) {281throw new InternalError(e);282}283}284285static InetAddress inet4LoopbackAddress() {286return inet4LoopbackAddress;287}288289static InetAddress inet6LoopbackAddress() {290return inet6LoopbackAddress;291}292293/**294* Returns the wildcard address that corresponds to the given protocol family.295*296* @see InetAddress#isAnyLocalAddress()297*/298static InetAddress anyLocalAddress(ProtocolFamily family) {299if (family == StandardProtocolFamily.INET) {300return anyLocalInet4Address;301} else if (family == StandardProtocolFamily.INET6) {302return anyLocalInet6Address;303} else {304throw new IllegalArgumentException();305}306}307308/**309* Returns any IPv4 address of the given network interface, or310* null if the interface does not have any IPv4 addresses.311*/312@SuppressWarnings("removal")313static Inet4Address anyInet4Address(final NetworkInterface interf) {314return AccessController.doPrivileged(new PrivilegedAction<Inet4Address>() {315public Inet4Address run() {316Enumeration<InetAddress> addrs = interf.getInetAddresses();317while (addrs.hasMoreElements()) {318InetAddress addr = addrs.nextElement();319if (addr instanceof Inet4Address) {320return (Inet4Address)addr;321}322}323return null;324}325});326}327328/**329* Returns an IPv4 address as an int.330*/331static int inet4AsInt(InetAddress ia) {332if (ia instanceof Inet4Address) {333byte[] addr = ia.getAddress();334int address = addr[3] & 0xFF;335address |= ((addr[2] << 8) & 0xFF00);336address |= ((addr[1] << 16) & 0xFF0000);337address |= ((addr[0] << 24) & 0xFF000000);338return address;339}340throw new AssertionError("Should not reach here");341}342343/**344* Returns an InetAddress from the given IPv4 address345* represented as an int.346*/347static InetAddress inet4FromInt(int address) {348byte[] addr = new byte[4];349addr[0] = (byte) ((address >>> 24) & 0xFF);350addr[1] = (byte) ((address >>> 16) & 0xFF);351addr[2] = (byte) ((address >>> 8) & 0xFF);352addr[3] = (byte) (address & 0xFF);353try {354return InetAddress.getByAddress(addr);355} catch (UnknownHostException uhe) {356throw new AssertionError("Should not reach here");357}358}359360/**361* Returns an IPv6 address as a byte array362*/363static byte[] inet6AsByteArray(InetAddress ia) {364if (ia instanceof Inet6Address) {365return ia.getAddress();366}367368// need to construct IPv4-mapped address369if (ia instanceof Inet4Address) {370byte[] ip4address = ia.getAddress();371byte[] address = new byte[16];372address[10] = (byte)0xff;373address[11] = (byte)0xff;374address[12] = ip4address[0];375address[13] = ip4address[1];376address[14] = ip4address[2];377address[15] = ip4address[3];378return address;379}380381throw new AssertionError("Should not reach here");382}383384// -- Socket options385386static final ExtendedSocketOptions extendedOptions =387ExtendedSocketOptions.getInstance();388389static void setSocketOption(FileDescriptor fd, SocketOption<?> name, Object value)390throws IOException391{392setSocketOption(fd, Net.UNSPEC, name, value);393}394395static void setSocketOption(FileDescriptor fd, ProtocolFamily family,396SocketOption<?> name, Object value)397throws IOException398{399if (value == null)400throw new IllegalArgumentException("Invalid option value");401402// only simple values supported by this method403Class<?> type = name.type();404405if (extendedOptions.isOptionSupported(name)) {406extendedOptions.setOption(fd, name, value);407return;408}409410if (type != Integer.class && type != Boolean.class)411throw new AssertionError("Should not reach here");412413// special handling414if (name == StandardSocketOptions.SO_RCVBUF ||415name == StandardSocketOptions.SO_SNDBUF)416{417int i = ((Integer)value).intValue();418if (i < 0)419throw new IllegalArgumentException("Invalid send/receive buffer size");420}421if (name == StandardSocketOptions.SO_LINGER) {422int i = ((Integer)value).intValue();423if (i < 0)424value = Integer.valueOf(-1);425if (i > 65535)426value = Integer.valueOf(65535);427}428if (name == StandardSocketOptions.IP_TOS) {429int i = ((Integer)value).intValue();430if (i < 0 || i > 255)431throw new IllegalArgumentException("Invalid IP_TOS value");432}433if (name == StandardSocketOptions.IP_MULTICAST_TTL) {434int i = ((Integer)value).intValue();435if (i < 0 || i > 255)436throw new IllegalArgumentException("Invalid TTL/hop value");437}438439// map option name to platform level/name440OptionKey key = SocketOptionRegistry.findOption(name, family);441if (key == null)442throw new AssertionError("Option not found");443444int arg;445if (type == Integer.class) {446arg = ((Integer)value).intValue();447} else {448boolean b = ((Boolean)value).booleanValue();449arg = (b) ? 1 : 0;450}451452boolean mayNeedConversion = (family == UNSPEC);453boolean isIPv6 = (family == StandardProtocolFamily.INET6);454setIntOption0(fd, mayNeedConversion, key.level(), key.name(), arg, isIPv6);455}456457static Object getSocketOption(FileDescriptor fd, SocketOption<?> name)458throws IOException459{460return getSocketOption(fd, Net.UNSPEC, name);461}462463static Object getSocketOption(FileDescriptor fd, ProtocolFamily family, SocketOption<?> name)464throws IOException465{466Class<?> type = name.type();467468if (extendedOptions.isOptionSupported(name)) {469return extendedOptions.getOption(fd, name);470}471472// only simple values supported by this method473if (type != Integer.class && type != Boolean.class)474throw new AssertionError("Should not reach here");475476// map option name to platform level/name477OptionKey key = SocketOptionRegistry.findOption(name, family);478if (key == null)479throw new AssertionError("Option not found");480481boolean mayNeedConversion = (family == UNSPEC);482int value = getIntOption0(fd, mayNeedConversion, key.level(), key.name());483484if (type == Integer.class) {485return Integer.valueOf(value);486} else {487return (value == 0) ? Boolean.FALSE : Boolean.TRUE;488}489}490491public static boolean isFastTcpLoopbackRequested() {492String loopbackProp = GetPropertyAction493.privilegedGetProperty("jdk.net.useFastTcpLoopback", "false");494return loopbackProp.isEmpty() ? true : Boolean.parseBoolean(loopbackProp);495}496497// -- Socket operations --498499private static native boolean isIPv6Available0();500501private static native boolean isReusePortAvailable0();502503/*504* Returns 1 for Windows and -1 for Linux/Mac OS505*/506private static native int isExclusiveBindAvailable();507508private static native boolean shouldSetBothIPv4AndIPv6Options0();509510private static native boolean canIPv6SocketJoinIPv4Group0();511512private static native boolean canJoin6WithIPv4Group0();513514private static native boolean canUseIPv6OptionsWithIPv4LocalAddress0();515516static FileDescriptor socket(boolean stream) throws IOException {517return socket(UNSPEC, stream);518}519520static FileDescriptor socket(ProtocolFamily family, boolean stream) throws IOException {521boolean preferIPv6 = isIPv6Available() &&522(family != StandardProtocolFamily.INET);523return IOUtil.newFD(socket0(preferIPv6, stream, false, fastLoopback));524}525526static FileDescriptor serverSocket(boolean stream) {527return serverSocket(UNSPEC, stream);528}529530static FileDescriptor serverSocket(ProtocolFamily family, boolean stream) {531boolean preferIPv6 = isIPv6Available() &&532(family != StandardProtocolFamily.INET);533return IOUtil.newFD(socket0(preferIPv6, stream, true, fastLoopback));534}535536// Due to oddities SO_REUSEADDR on windows reuse is ignored537private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse,538boolean fastLoopback);539540public static void bind(FileDescriptor fd, InetAddress addr, int port)541throws IOException542{543bind(UNSPEC, fd, addr, port);544}545546static void bind(ProtocolFamily family, FileDescriptor fd,547InetAddress addr, int port) throws IOException548{549boolean preferIPv6 = isIPv6Available() &&550(family != StandardProtocolFamily.INET);551if (addr.isLinkLocalAddress()) {552addr = IPAddressUtil.toScopedAddress(addr);553}554bind0(fd, preferIPv6, exclusiveBind, addr, port);555}556557private static native void bind0(FileDescriptor fd, boolean preferIPv6,558boolean useExclBind, InetAddress addr,559int port)560throws IOException;561562static native void listen(FileDescriptor fd, int backlog) throws IOException;563564static int connect(FileDescriptor fd, InetAddress remote, int remotePort)565throws IOException566{567return connect(UNSPEC, fd, remote, remotePort);568}569570static int connect(ProtocolFamily family, FileDescriptor fd, InetAddress remote, int remotePort)571throws IOException572{573if (remote.isLinkLocalAddress()) {574remote = IPAddressUtil.toScopedAddress(remote);575}576boolean preferIPv6 = isIPv6Available() &&577(family != StandardProtocolFamily.INET);578return connect0(preferIPv6, fd, remote, remotePort);579}580581static int connect(ProtocolFamily family, FileDescriptor fd, SocketAddress remote)582throws IOException583{584InetSocketAddress isa = (InetSocketAddress) remote;585return connect(family, fd, isa.getAddress(), isa.getPort());586}587588private static native int connect0(boolean preferIPv6,589FileDescriptor fd,590InetAddress remote,591int remotePort)592throws IOException;593594public static native int accept(FileDescriptor fd,595FileDescriptor newfd,596InetSocketAddress[] isaa)597throws IOException;598599public static final int SHUT_RD = 0;600public static final int SHUT_WR = 1;601public static final int SHUT_RDWR = 2;602603static native void shutdown(FileDescriptor fd, int how) throws IOException;604605private static native int localPort(FileDescriptor fd)606throws IOException;607608private static native InetAddress localInetAddress(FileDescriptor fd)609throws IOException;610611public static InetSocketAddress localAddress(FileDescriptor fd)612throws IOException613{614return new InetSocketAddress(localInetAddress(fd), localPort(fd));615}616617private static native int remotePort(FileDescriptor fd)618throws IOException;619620private static native InetAddress remoteInetAddress(FileDescriptor fd)621throws IOException;622623static InetSocketAddress remoteAddress(FileDescriptor fd)624throws IOException625{626return new InetSocketAddress(remoteInetAddress(fd), remotePort(fd));627}628629private static native int getIntOption0(FileDescriptor fd, boolean mayNeedConversion,630int level, int opt)631throws IOException;632633private static native void setIntOption0(FileDescriptor fd, boolean mayNeedConversion,634int level, int opt, int arg, boolean isIPv6)635throws IOException;636637/**638* Polls a file descriptor for events.639* @param timeout the timeout to wait; 0 to not wait, -1 to wait indefinitely640* @return the polled events or 0 if no events are polled641*/642static native int poll(FileDescriptor fd, int events, long timeout)643throws IOException;644645/**646* Performs a non-blocking poll of a file descriptor.647* @return the polled events or 0 if no events are polled648*/649static int pollNow(FileDescriptor fd, int events) throws IOException {650return poll(fd, events, 0);651}652653/**654* Polls a connecting socket to test if the connection has been established.655*656* @apiNote This method is public to allow it be used by code in jdk.sctp.657*658* @param timeout the timeout to wait; 0 to not wait, -1 to wait indefinitely659* @return true if connected660*/661public static native boolean pollConnect(FileDescriptor fd, long timeout)662throws IOException;663664/**665* Performs a non-blocking poll of a connecting socket to test if the666* connection has been established.667*668* @return true if connected669*/670static boolean pollConnectNow(FileDescriptor fd) throws IOException {671return pollConnect(fd, 0);672}673674/**675* Return the number of bytes in the socket input buffer.676*/677static native int available(FileDescriptor fd) throws IOException;678679/**680* Send one byte of urgent data (MSG_OOB) on the socket.681*/682static native int sendOOB(FileDescriptor fd, byte data) throws IOException;683684/**685* Read and discard urgent data (MSG_OOB) on the socket.686*/687static native boolean discardOOB(FileDescriptor fd) throws IOException;688689// -- Multicast support --690691/**692* Join IPv4 multicast group693*/694static int join4(FileDescriptor fd, int group, int interf, int source)695throws IOException696{697return joinOrDrop4(true, fd, group, interf, source);698}699700/**701* Drop membership of IPv4 multicast group702*/703static void drop4(FileDescriptor fd, int group, int interf, int source)704throws IOException705{706joinOrDrop4(false, fd, group, interf, source);707}708709private static native int joinOrDrop4(boolean join, FileDescriptor fd, int group, int interf, int source)710throws IOException;711712/**713* Block IPv4 source714*/715static int block4(FileDescriptor fd, int group, int interf, int source)716throws IOException717{718return blockOrUnblock4(true, fd, group, interf, source);719}720721/**722* Unblock IPv6 source723*/724static void unblock4(FileDescriptor fd, int group, int interf, int source)725throws IOException726{727blockOrUnblock4(false, fd, group, interf, source);728}729730private static native int blockOrUnblock4(boolean block, FileDescriptor fd, int group,731int interf, int source)732throws IOException;733734/**735* Join IPv6 multicast group736*/737static int join6(FileDescriptor fd, byte[] group, int index, byte[] source)738throws IOException739{740return joinOrDrop6(true, fd, group, index, source);741}742743/**744* Drop membership of IPv6 multicast group745*/746static void drop6(FileDescriptor fd, byte[] group, int index, byte[] source)747throws IOException748{749joinOrDrop6(false, fd, group, index, source);750}751752private static native int joinOrDrop6(boolean join, FileDescriptor fd, byte[] group, int index, byte[] source)753throws IOException;754755/**756* Block IPv6 source757*/758static int block6(FileDescriptor fd, byte[] group, int index, byte[] source)759throws IOException760{761return blockOrUnblock6(true, fd, group, index, source);762}763764/**765* Unblock IPv6 source766*/767static void unblock6(FileDescriptor fd, byte[] group, int index, byte[] source)768throws IOException769{770blockOrUnblock6(false, fd, group, index, source);771}772773static native int blockOrUnblock6(boolean block, FileDescriptor fd, byte[] group, int index, byte[] source)774throws IOException;775776static native void setInterface4(FileDescriptor fd, int interf) throws IOException;777778static native int getInterface4(FileDescriptor fd) throws IOException;779780static native void setInterface6(FileDescriptor fd, int index) throws IOException;781782static native int getInterface6(FileDescriptor fd) throws IOException;783784private static native void initIDs();785786/**787* Event masks for the various poll system calls.788* They will be set platform dependent in the static initializer below.789*/790public static final short POLLIN;791public static final short POLLOUT;792public static final short POLLERR;793public static final short POLLHUP;794public static final short POLLNVAL;795public static final short POLLCONN;796797static native short pollinValue();798static native short polloutValue();799static native short pollerrValue();800static native short pollhupValue();801static native short pollnvalValue();802static native short pollconnValue();803804static {805IOUtil.load();806initIDs();807808POLLIN = pollinValue();809POLLOUT = polloutValue();810POLLERR = pollerrValue();811POLLHUP = pollhupValue();812POLLNVAL = pollnvalValue();813POLLCONN = pollconnValue();814}815816static {817int availLevel = isExclusiveBindAvailable();818if (availLevel >= 0) {819String exclBindProp = GetPropertyAction820.privilegedGetProperty("sun.net.useExclusiveBind");821if (exclBindProp != null) {822exclusiveBind = exclBindProp.isEmpty() ?823true : Boolean.parseBoolean(exclBindProp);824} else if (availLevel == 1) {825exclusiveBind = true;826} else {827exclusiveBind = false;828}829} else {830exclusiveBind = false;831}832833fastLoopback = isFastTcpLoopbackRequested();834}835}836837838