You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some question that asked before in stack overflow without good responses, May be it's a feature request I'm not sure, Please help me
I have an instance of Client in my application, it is the only client that I send request to the server, Today I see that there is a client.close() method, If you call it , you cannot send request anymore.
I want to know :
1. How many connections can be created by a Client in flutter
In the official document we have
The interface for HTTP clients that take care of maintaining persistent connections across multiple requests to the same server.
So I think Client create a connection and do it best to keep it alive, I think If the server cannot support persistent connections or close the connection, The Client will create another connection on the next request, Right?
Also I think there is no connection pooling and If I want to have 2 connection simultaneously I must create 2 Client instace
What happens if we have multiple host, for instance s1.example.com , s2.example.com ,another.com:8080
2. What will happen if I have a global Client and we lose connection, i.e: disconnecting from the internet
I think as we have persistent connections for short network issue, the connection is not lost, but for long issues or OS detection it will lost but for the next request client will create another connection
3. How many concurrent requests can be sent by a Client?
As I think a client has only a persisted connection (I'm not sure about multiple hostname, May be a persisted connection per hostname) , It queue request and we cannot have concurrent requests
4. Is using a global Client a bad idea?
What happened if I never call client.close(), and use an instance of Client globally, I think downloading and uploading large files will block subsequent requests
The text was updated successfully, but these errors were encountered:
@guilherme-v I have some new experience with Client I figured out that we can t have concurrent requests, I test both concurrent
uploading and downloading large files with a single Client
I just cannot understand why there is no way to cancel a single request and we must call client.close() ?
So I think Client create a connection and do it best to keep it alive, I think If the server cannot support persistent connections or close the connection, The Client will create another connection on the next request, Right?
I don't think we do anything in this package to hold connections.
I have some question that asked before in stack overflow without good responses, May be it's a feature request I'm not sure, Please help me
I have an instance of Client in my application, it is the only client that I send request to the server, Today I see that there is a
client.close()
method, If you call it , you cannot send request anymore.I want to know :
1. How many connections can be created by a Client in flutter
In the official document we have
So I think
Client
create a connection and do it best to keep it alive, I think If the server cannot support persistent connections or close the connection, TheClient
will create another connection on the next request, Right?Also I think there is no connection pooling and If I want to have 2 connection simultaneously I must create 2 Client instace
What happens if we have multiple host, for instance
s1.example.com
,s2.example.com
,another.com:8080
2. What will happen if I have a global Client and we lose connection, i.e: disconnecting from the internet
I think as we have persistent connections for short network issue, the connection is not lost, but for long issues or OS detection it will lost but for the next request client will create another connection
3. How many concurrent requests can be sent by a Client?
As I think a client has only a persisted connection (I'm not sure about multiple hostname, May be a persisted connection per hostname) , It queue request and we cannot have concurrent requests
4. Is using a global Client a bad idea?
What happened if I never call
client.close()
, and use an instance ofClient
globally, I think downloading and uploading large files will block subsequent requestsThe text was updated successfully, but these errors were encountered: