-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[core,tls] Use BIO_wait_read replace event #11650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check transport_layer_bio_ctrl
for an implementation of this.
your change breaks the transport abstraction (wait for stuff other than the socket), sorry :/
I am checked transport_layer_bio_ctrl. |
@KangLin Consider the direct connection (no gateway):
|
so, this sounds like you need your own implementation of that layer based on |
yes. it isn't wait abortEVENT in here.
It's used for the main event loop, but it's not suitable for use here. |
Yes. see: |
TLS should not block here alone. 0 should be returned directly and then from the main event loop into state machine. |
@KangLin do I see this correct that you try to open a that is already available with default implementation, see
well, it will block if your connection has high latency for example |
but you can combine the
there is no main event loop during |
|
The rdpTransportLayer.GetEvent is used for noblocking. So rdpTransportLayer.Wait is better than rdpTransportLayer.GetEvent here. |
@KangLin the opposite is the case. We're trying to remove all locations where you need a blocking (unconditional) wait that can not be broken by Here we have a blocking loop with a timeout. (yes, it is currently not 100% consistent, but the above is the idea that the implementation should conform to) in any case, if you have a problem in your implementation, then I'd check that first, as mentioned before, the current implementation can already reuse an already opened socket without any modifications. |
There is nothing problem with my current implementation.
#11651 I don't think this solves the problem. I think this is a program framework design problem. I think the final approach is the design should be based on event-driven. No need to block internally. When data cannot be read, it returns directly to the main event loop and waits for the next time data can be read, and then executes according to the current status again. The current BIO design has two layers, the upper layer is the memory cache and the lower layer is the connection layer. |
Events may be invalid, so you should use BIO_wait_read.
ag:
QTcpSocket, If the socket is using QNetworkProxy, the returned descriptor may not be usable with native socket functions.
See: https://doc.qt.io/qt-6/qabstractsocket.html#socketDescriptor