How can I reconnect scz server manually?

Now I met a problem that we Frequently disconnect when I create a model connect with hoops server,there are some server logs below.

2025/04/25 09:51:30 [debug] 19#0: *973 recv: fd:25 -1 of 4096
2025/04/25 09:51:30 [info] 19#0: *973 recv() failed (104: Connection reset by peer) while proxying upgraded connection, client: 10.251.14.1, server: , request: “GET /ws/scz?renderingLocation=csr HTTP/1.1”, upstream: “http://10.250.73.95:8998/ws/scz?renderingLocation=csr”, host: “fview-uat.geely-test.com
2025/04/25 09:51:30 [debug] 19#0: *973 http upstream upgraded done

It’s possible that the data was sent too frequently, resulting in the connection being reset.

My client requires that the support of my hoops web client remain open throughout the day, and there is a need for enhanced connection and heartbeat check mechanisms.

Does hoops support these functions?

How can I establish a reconnection method through hoops?

Thanks a lot! plz help me ,its so hard for me .

Hello @Ying.Li11,

The server log snippet you provided seems to be coming from Nginx. Nothing jumps out to us as to the causes of the disconnection issue that you are experiencing. Have you had the opportunity to look at other forum posts on setting up the server, for exampe:

Thanks,
Tino

Hi tino,the problem is that the connect will break down when I use scz stream server.I cannot find the real reason to solve the problem. Is the model so big ? we often failed that the model scz file is so large.

Another condition that is different from the hoops demo is that my server is java. Will this have an impact? Although the server of the hoops demo is nodejs

I read my code,I found that we connect ts3d server directly ,but nodejs demo code tell us that we have to wait to recived the “ready” signal.
here are the pic that I screened.

Does it effect? or have another solver for this problem?

Based on the screenshots, nothing jumps as as being the cause of server disconnection. Nor do I suspect that Java versus Node is having an effect.

Let’s try taking a look at the Communicator logs which is specified in the server_config.js file based to the server. By default, the name of the folder is called ts3d_communicator_logs so you can just do a search for this folder. The folder will contain logs for the server and SSR (server side rendering) and CSR (client side rendering) spawned instanced.

I record some error logs , please help me to analysis the logs.

the connect will interrupt when data transfering,

we would see the error :lws: getpeername: Transport endpoint is not connected?

Thu Jun  5 18:11:50 2025.0.188:dbug: data: term=End, rx=0, tx=65520, rx-rate=0Kb/s, tx-rate=3744.18Kb/s, rx-total=9.554Kb, tx-total=910260Kb
Thu Jun  5 18:11:50 2025.0.188:dbug: data: term=End, rx=0, tx=24084, rx-rate=0Kb/s, tx-rate=3768.26Kb/s, rx-total=9.554Kb, tx-total=910284Kb
Thu Jun  5 18:11:50 2025.0.229:dbug: data: term=End, rx=0, tx=65520, rx-rate=0Kb/s, tx-rate=3833.78Kb/s, rx-total=9.554Kb, tx-total=910349Kb
Thu Jun  5 18:11:50 2025.0.230:dbug: data: term=End, rx=0, tx=65520, rx-rate=0Kb/s, tx-rate=3899.3Kb/s, rx-total=9.554Kb, tx-total=910415Kb
Thu Jun  5 18:11:50 2025.0.230:dbug: data: term=End, rx=0, tx=20660, rx-rate=0Kb/s, tx-rate=3919.96Kb/s, rx-total=9.554Kb, tx-total=910435Kb
Thu Jun  5 18:11:50 2025.0.230:dbug: data: term=End, rx=0, tx=65520, rx-rate=0Kb/s, tx-rate=3985.48Kb/s, rx-total=9.554Kb, tx-total=910501Kb
Thu Jun  5 18:11:50 2025.0.230:dbug: data: term=End, rx=0, tx=55672, rx-rate=0Kb/s, tx-rate=4041.15Kb/s, rx-total=9.554Kb, tx-total=910557Kb
Thu Jun  5 18:12:49 2025.0.683:dbug: lws: getpeername: Transport endpoint is not connected
Thu Jun  5 18:12:49 2025.0.684:dbug: 2025-06-05 18:12:49 !command.context->is_connected()
Thu Jun  5 18:12:49 2025.0.684:dbug: 2025-06-05 18:12:49 !!! start releasing model !!!
Thu Jun  5 18:12:49 2025.0.971:dbug: 2025-06-05 18:12:49 !!! finished release model!!!
Thu Jun  5 18:12:49 2025.0.983:dbug: lws: lws_context_destroy




Thanks for providing the log details.

I noticed that the getpeername call occurs roughly 1 minute after the previous entry in the log. Do you know if this 1 minute is always consistent. If so, this can indicate that the server has a timeout setting.

The Web Viewer does have the method setClientTimeout but by default this occurs after 15 mintues of inactivity. So perhaps the timeout is being set somewhere else in your server.

However, the situation is like this. Currently, I’m using scz to load a relatively large model. Occasionally, it loads normally, but sometimes it doesn’t. This occurs in the log file. If you say it’s a timeout setting on the server side, it should be a problem that always occurs, disconnecting every time. But no, it only disconnects occasionally.

This is a probabilistic disconnection problem.

@Ying.Li11,

I’ve sent to a file request to your email address for the SCZ file. I’d like to take a closer look at it.

Thanks,
Tino

I hava a question about scz streaming rendering.
if I build a connect throuth a loadName , hoops c++ server will read other file slices or only read a whole file ? which way does hoops do ?
I must realized the number of files so that I can send you a right SCZ file.

I think you are referring to the function loadSubtreeFromModel (but there are variants). This function needs a complete filename to load the model but this function can be called multiple times. As a check, please do a search for “loadSubtreeFrom” in your code and let me know which function is being called.

  /** Creates a viewer that will directly connect to a server using a websocket URI.
   * @param {string} uri */
  _createDirectConnectViewer: function (uriRoot) {
    var renderingLocation = Sample._getRenderingLocationString();
    var fullUri = uriRoot + '?renderingLocation=' + renderingLocation;

    /** @type {Communicator.WebViewerConfig} */
    var config = {
      containerId: this._config.viewerId || 'viewerContainer',
      endpointUri: fullUri,
      model: this._config.modelName, //'8894982415_null', //Sample._getModel(),
      rendererType: Sample._getRendererType(),
      streamingMode: Sample._getStreamingMode(),
      memoryLimit: Sample._getMemoryLimit(),
      boundingPreviewMode: 0,
    };
    Sample._applyExtraProperties(config);
    var viewer = new Communicator.WebViewer(config);

    return Promise.resolve(viewer);
  },

firstly,I am sorry about that I`m too late to response to your reply.
I have already read the place where I called,I found that only use the demo “Sample Code”, I have no use to “loadSubtreeFrom”.

when I build a ws(wss) connect with server,How many files will I read from the server in the end?
I know my model should be a large model.
Theoretically, it should be an assembly with many subsets.
I don’t know the principle of loading files on the hoops server because it’s a black box. Could you help me explain it? thx a lot .

Based on the code you provided, it does not look like you are aggregating models in the viewer and instead, just loading a monolithic Stream Cache file. All that is to say that you are loading a single Stream Cache file containing a model with likely many different assemblies and sub-assemblies.

I had sent to a file request to your email address. Please use the upload link in that email to send me the one Stream Cache file.

Hi ,tino

thanx for your help,I had sent a file to u,please help me to solve the problem that it`s so puzzle for me .


could u see my picture?
I have ran a demo project , but I met the problem that hoops request to load another file ,but I only download one file and send u.
why this will happen? why does the engine load another file ?
we just discuss that we guess that there only big file that when I use scz to load.

Initially, I thought you were loading one large Stream Cache file given that you were not using loadSubtreeFrom* function to aggregate individual models. But since you are seeing “requests” to load another file, you may be using a shattered workflow which uses a master model as a link to other SC files.

It will be easier to send me files via the Support Portal. To that end, I will initiate the process of creating a support account for you. You will receive confirmations via your email.

Hi tono , we haven`t sent u the origin 3dfile yet,But I have some problem about that can we update java server sokect version to solve this question?

Now I have a code

      <dependency>
            <groupId>io.socket</groupId>
            <artifactId>socket.io-server</artifactId>
            <version>4.0.1</version>
        </dependency>

can i use socketio https://github.com/socketio/socket.io to Initiate a websocket?
But I found that the method for initiating the socket is encapsulated in the Communicator sdk 。

Can u support a demo for me that how to use the “socket” lib wo build the scz connection?
Or does Communicator not support doing so。

So much thanx to U。