{"record":{"id":"e0dd30bf4f05b31c","repo":"grpc/grpc-java","slug":"unsupported-operation-getoobinline","errorCode":null,"errorMessage":"Unsupported operation getOOBInline()","messagePattern":"Unsupported operation getOOBInline\\(\\)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"android/src/main/java/io/grpc/android/UdsSocket.java","lineNumber":133,"sourceCode":"\n  @Override\n  public InetAddress getLocalAddress() {\n    throw new UnsupportedOperationException(\"Unsupported operation getLocalAddress()\");\n  }\n\n  @Override\n  public int getLocalPort() {\n    throw new UnsupportedOperationException(\"Unsupported operation getLocalPort()\");\n  }\n\n  @Override\n  public SocketAddress getLocalSocketAddress() {\n    return new SocketAddress() {};\n  }\n\n  @Override\n  public boolean getOOBInline() {\n    throw new UnsupportedOperationException(\"Unsupported operation getOOBInline()\");\n  }\n\n  @Override\n  public OutputStream getOutputStream() throws IOException {\n    return new FilterOutputStream(localSocket.getOutputStream()) {\n      @Override\n      public void close() throws IOException {\n        UdsSocket.this.close();\n      }\n    };\n  }\n\n  @Override\n  public int getPort() {\n    throw new UnsupportedOperationException(\"Unsupported operation getPort()\");\n  }\n\n  @Override","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/android/src/main/java/io/grpc/android/UdsSocket.java#L115-L151","documentation":"UdsSocket emulates java.net.Socket over an Android LocalSocket. TCP out-of-band inline data (OOBINLINE, urgent data) has no counterpart on LocalSocket/Unix Domain Sockets, so getOOBInline() throws UnsupportedOperationException by design, like the other unsupported TCP option accessors in this class.","triggerScenarios":"Calling getOOBInline() on the UdsSocket produced by UdsSocketFactory — typically generic socket-option snapshot code or libraries that read all TCP options after connect.","commonSituations":"Connection diagnostics tools enumerating socket options; code ported from TCP-only contexts that unconditionally reads OOBINLINE; test harnesses asserting socket configuration.","solutions":["Do not read TCP-specific options (OOBINLINE, TCP_NODELAY, SO_LINGER, etc.) on UDS sockets.","Guard option access with a UdsSocket class check or catch UnsupportedOperationException in shared socket-handling paths.","Set channel-level behavior via gRPC channel options instead of raw socket options."],"exampleFix":"// before\nboolean oob = socket.getOOBInline();\n// after\nboolean oob = socket.getClass().getSimpleName().equals(\"UdsSocket\")\n    ? false\n    : socket.getOOBInline();","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"static boolean supportsTcpOptions(Socket s) {\n  return !s.getClass().getName().equals(\"io.grpc.android.UdsSocket\");\n}","tryCatchPattern":"try {\n  boolean oob = socket.getOOBInline();\n} catch (UnsupportedOperationException e) {\n  // UDS socket: TCP urgent-data options do not apply\n}","preventionTips":["Enumerate socket options only for plain TCP sockets.","Treat all UdsSocket option accessors (keepAlive, OOBInline, linger, etc.) as unsupported.","Configure behavior at the gRPC channel level rather than via raw socket options."],"tags":["grpc","android","unix-domain-socket","socket-options","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"64daddc1f3d1975670f769f3e97bde8b2ba32d25","analyzedAt":"2026-09-08T06:14:57.704Z","contentChangedAt":"2026-09-08T06:14:57.704Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}