alwaysbusy Expert Licensed User Longtime User Mar 10, 2016 #1 I'm experiencing Timeouts in on the server side streaming audio files. Although these messages appear in the log, the audio file keeps playing. Code: java.util.concurrent.TimeoutException: Idle timeout expired: 30001/30000 ms at org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:166) at org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 2016-03-10 17:18:35.259:WARN:oejs.HttpChannel:qtp23170705-13: //localhost:51042/demo/Audio/04%20Steal.mp3 java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 30001/30000 ms at org.eclipse.jetty.util.SharedBlockingCallback$Blocker.block(SharedBlockingCallback.java:226) at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:164) at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:436) at org.eclipse.jetty.util.IO.copy(IO.java:163) at org.eclipse.jetty.util.resource.Resource.writeTo(Resource.java:682) at org.eclipse.jetty.servlet.DefaultServlet.sendData(DefaultServlet.java:995) at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:520) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) at org.eclipse.jetty.server.Server.handle(Server.java:517) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) at java.lang.Thread.run(Thread.java:745) Searching the net, I should be able to extend this timeout, e.g maxIdleTime=500000. (it is 30000 by default). I tried: Code: srvr.SetStaticFilesOptions(CreateMap("cacheControl": "max-age=604800,public","gzip":True,"dirAllowed":False, "maxIdleTime":"500000")) But I do not think this is the right place to set this param (it is ignored).
I'm experiencing Timeouts in on the server side streaming audio files. Although these messages appear in the log, the audio file keeps playing. Code: java.util.concurrent.TimeoutException: Idle timeout expired: 30001/30000 ms at org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:166) at org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 2016-03-10 17:18:35.259:WARN:oejs.HttpChannel:qtp23170705-13: //localhost:51042/demo/Audio/04%20Steal.mp3 java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 30001/30000 ms at org.eclipse.jetty.util.SharedBlockingCallback$Blocker.block(SharedBlockingCallback.java:226) at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:164) at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:436) at org.eclipse.jetty.util.IO.copy(IO.java:163) at org.eclipse.jetty.util.resource.Resource.writeTo(Resource.java:682) at org.eclipse.jetty.servlet.DefaultServlet.sendData(DefaultServlet.java:995) at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:520) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) at org.eclipse.jetty.server.Server.handle(Server.java:517) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) at java.lang.Thread.run(Thread.java:745) Searching the net, I should be able to extend this timeout, e.g maxIdleTime=500000. (it is 30000 by default). I tried: Code: srvr.SetStaticFilesOptions(CreateMap("cacheControl": "max-age=604800,public","gzip":True,"dirAllowed":False, "maxIdleTime":"500000")) But I do not think this is the right place to set this param (it is ignored).
Erel B4X founder Staff member Licensed User Longtime User Mar 11, 2016 #2 It is not a general timeout. It means that there was no activity for more than 30 seconds (during the connection). The connection might have been closed by the client at some point. http://stackoverflow.com/questions/3094221/jetty-maxidletime?rq=1 Upvote 0
It is not a general timeout. It means that there was no activity for more than 30 seconds (during the connection). The connection might have been closed by the client at some point. http://stackoverflow.com/questions/3094221/jetty-maxidletime?rq=1
alwaysbusy Expert Licensed User Longtime User Mar 11, 2016 #3 That is probably true. It has to load a mp3 of 11Mb. After 7.6 Mb it stops buffering and start playing. When it reaches 30 seconds into the song, it still has plenty of the song into the buffer so it does not communicate with the socket, giving this error. Upvote 0
That is probably true. It has to load a mp3 of 11Mb. After 7.6 Mb it stops buffering and start playing. When it reaches 30 seconds into the song, it still has plenty of the song into the buffer so it does not communicate with the socket, giving this error.
alwaysbusy Expert Licensed User Longtime User Mar 11, 2016 #4 I solved the issue on the browsers side, but just out of curiosity, where could I set the Jetty idleTimeout parameter in B4J? Is SetStaticFilesOptions the right place? Upvote 0
I solved the issue on the browsers side, but just out of curiosity, where could I set the Jetty idleTimeout parameter in B4J? Is SetStaticFilesOptions the right place?
Erel B4X founder Staff member Licensed User Longtime User Mar 13, 2016 #5 You can use this code: Code: srvr.Start Dim jo As JavaObject = srvr Dim connectors() As Object = jo.GetFieldJO("server").RunMethod("getConnectors", Null) Dim timeout As Long = 50000 For Each c As JavaObject In connectors c.RunMethod("setIdleTimeout", Array(timeout)) Next Upvote 0
You can use this code: Code: srvr.Start Dim jo As JavaObject = srvr Dim connectors() As Object = jo.GetFieldJO("server").RunMethod("getConnectors", Null) Dim timeout As Long = 50000 For Each c As JavaObject In connectors c.RunMethod("setIdleTimeout", Array(timeout)) Next
ilan Expert Licensed User Longtime User Mar 18, 2021 #6 alwaysbusy said: I solved the issue on the browsers side Click to expand... can you please explain how? i am streaming mp4 movies on my server and every time i load a video i get after 30sec this error message. everything keeps working fine but i still get this error. can you please tell me how you solved it? thanx Upvote 0
alwaysbusy said: I solved the issue on the browsers side Click to expand... can you please explain how? i am streaming mp4 movies on my server and every time i load a video i get after 30sec this error message. everything keeps working fine but i still get this error. can you please tell me how you solved it? thanx
alwaysbusy Expert Licensed User Longtime User Mar 18, 2021 #7 I am sorry Ilan, but I have absolutely no idea what I would have done Upvote 0
ilan Expert Licensed User Longtime User Mar 18, 2021 #8 alwaysbusy said: I am sorry Ilan, but I have absolutely no idea what I would have done Click to expand... but you wrote that you solved it?? Upvote 0
alwaysbusy said: I am sorry Ilan, but I have absolutely no idea what I would have done Click to expand... but you wrote that you solved it??
alwaysbusy Expert Licensed User Longtime User Mar 18, 2021 #9 ilan said: but you wrote that you solved it?? Click to expand... Well, yes, 5 years ago... Upvote 0
Cableguy Expert Licensed User Longtime User Mar 18, 2021 #10 alwaysbusy said: Well, yes, 5 years ago... Click to expand... And this line gives birth to a new forum wish.... Upvote 0
alwaysbusy said: Well, yes, 5 years ago... Click to expand... And this line gives birth to a new forum wish....
B bridge1 Member May 23, 2022 #11 Erel said: You can use this code: Code: srvr.Start Dim jo As JavaObject = srvr Dim connectors() As Object = jo.GetFieldJO("server").RunMethod("getConnectors", Null) Dim timeout As Long = 50000 For Each c As JavaObject In connectors c.RunMethod("setIdleTimeout", Array(timeout)) Next Click to expand... [CODE lang="b4x" title="GetIdleTimeout"] Sub Process_Globals Private serverHTTP As HttpServer Private mPort As Int = 4444 End Sub Sub Service_Create serverHTTP.Initialize("serverHTTP") serverHTTP.Start(mPort) End Sub Public Sub GetIdleTimeout As Int() Dim joServerHttp As JavaObject = serverHTTP Dim joSrv As JavaObject = joServerHttp.GetFieldJO("server") End Sub [/CODE] Using the HttpServer library, trying to retrieve the server object, reports the following error. java.lang.RuntimeException: Field: server not found in: anywheresoftware.b4a.objects.HttpServer Note that in debug, for object joServerHttp, server object is displayed. What can we do? Thank you. Upvote 0
Erel said: You can use this code: Code: srvr.Start Dim jo As JavaObject = srvr Dim connectors() As Object = jo.GetFieldJO("server").RunMethod("getConnectors", Null) Dim timeout As Long = 50000 For Each c As JavaObject In connectors c.RunMethod("setIdleTimeout", Array(timeout)) Next Click to expand... [CODE lang="b4x" title="GetIdleTimeout"] Sub Process_Globals Private serverHTTP As HttpServer Private mPort As Int = 4444 End Sub Sub Service_Create serverHTTP.Initialize("serverHTTP") serverHTTP.Start(mPort) End Sub Public Sub GetIdleTimeout As Int() Dim joServerHttp As JavaObject = serverHTTP Dim joSrv As JavaObject = joServerHttp.GetFieldJO("server") End Sub [/CODE] Using the HttpServer library, trying to retrieve the server object, reports the following error. java.lang.RuntimeException: Field: server not found in: anywheresoftware.b4a.objects.HttpServer Note that in debug, for object joServerHttp, server object is displayed. What can we do? Thank you.
Erel B4X founder Staff member Licensed User Longtime User May 23, 2022 #12 1. You are using the wrong library. You should use jServer. 2. You are posting in the wrong place. Always start a new thread for your questions. Upvote 0
1. You are using the wrong library. You should use jServer. 2. You are posting in the wrong place. Always start a new thread for your questions.