{"record":{"id":"c72b528ac811b2e9","repo":"libgdx/libgdx","slug":"not-implemented-c72b52","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtNet.java","lineNumber":208,"sourceCode":"\t\tHttpResponseListener httpResponseListener = listeners.get(httpRequest);\n\t\tRequest request = requests.get(httpRequest);\n\n\t\tif (httpResponseListener != null && request != null) {\n\t\t\trequest.cancel();\n\t\t\thttpResponseListener.cancelled();\n\t\t\trequests.remove(httpRequest);\n\t\t\tlisteners.remove(httpRequest);\n\t\t}\n\t}\n\n\t@Override\n\tpublic boolean isHttpRequestPending (HttpRequest httpRequest) {\n\t\treturn listeners.get(httpRequest) != null && requests.get(httpRequest) != null;\n\t}\n\n\t@Override\n\tpublic ServerSocket newServerSocket (Protocol protocol, String hostname, int port, ServerSocketHints hints) {\n\t\tthrow new UnsupportedOperationException(\"Not implemented\");\n\t}\n\n\t@Override\n\tpublic ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {\n\t\tthrow new UnsupportedOperationException(\"Not implemented\");\n\t}\n\n\t@Override\n\tpublic Socket newClientSocket (Protocol protocol, String host, int port, SocketHints hints) {\n\t\tthrow new UnsupportedOperationException(\"Not implemented\");\n\t}\n\n\t@Override\n\tpublic boolean openURI (String URI) {\n\t\tif (config.openURLInNewWindow) {\n\t\t\tWindow.open(URI, \"_blank\", null);\n\t\t} else {\n\t\t\tWindow.Location.assign(URI);","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/libgdx/libgdx/blob/97f40861878058087be0685ca167ddfde132134b/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtNet.java#L190-L226","documentation":"Net.newServerSocket throws UnsupportedOperationException(\"Not implemented\") in the GWT backend because browsers cannot open listening TCP sockets. The Net interface includes raw socket APIs, but only the HTTP subset is implementable in a browser sandbox.","triggerScenarios":"Calling Gdx.net.newServerSocket(protocol, hostname, port, hints) or the port-only overload on the GWT backend; any attempt to host a socket server from the HTML5 build.","commonSituations":"Multiplayer code that hosts a local TCP server on desktop being reused in the HTML5 target; tooling that assumes the full Net API exists on every backend.","solutions":["Do not host servers in the browser: move the server to a dedicated process and have the GWT client connect via WebSocket or HTTP","Guard server-socket creation with Gdx.app.getType() != ApplicationType.WebGL and skip/notify on web","Abstract Net usage behind an interface with a WebGL implementation that only supports client HTTP/WebSocket"],"exampleFix":"// before\nServerSocket server = Gdx.net.newServerSocket(Protocol.TCP, port, null);\n\n// after\nif (Gdx.app.getType() != ApplicationType.WebGL) {\n    ServerSocket server = Gdx.net.newServerSocket(Protocol.TCP, port, null);\n} else {\n    // connect to an external WebSocket server instead\n}","handlingStrategy":"validation","validationCode":"static boolean canHostSockets () {\n    return Gdx.app.getType() != ApplicationType.WebGL;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Architect web clients as pure clients; hosting belongs on a server process","Hide Net socket APIs behind your own interface with per-backend implementations","Check application type before any server-socket creation in shared code"],"tags":["gwt","sockets","network","libgdx","unsupported-operation"],"backgroundTag":null,"analyzedSha":"97f40861878058087be0685ca167ddfde132134b","analyzedAt":"2026-08-14T10:52:53.492Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}