Io socket handle for internal socket#13418
Conversation
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
|
Please ping when this is ready for review. |
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
|
@alyssawilk merged master and implement new socket api. Now the test should be passing and compatible with master... |
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
alyssawilk
left a comment
There was a problem hiding this comment.
Hey @lambdai, great to see this moving forward. Sending first pass comments your way
lambdai
left a comment
There was a problem hiding this comment.
@alyssawilk Thanks! I will update the PR reflecting your comment!
However the pointers cannot be changed to references based on the current design(construct in pair). Maybe I am missing anything?
Currently the default impl is weak. Alternatively the feature experimenting procedure can be done through improving DefaultEventListener. |
I need a complicated EventListener implementation to supporting CLOSED event. EV_CLOSED is not a MUST-have but a nice-to-have is that IIRC libevent only deliver EV_CLOSED if the poller is epoll. I add the TODO for now |
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
yanavlasov
left a comment
There was a problem hiding this comment.
Initial pass. There is a lot to digest here. Will continue tomorrow.
Signed-off-by: Yuchen Dai <[email protected]>
|
Adding test coverage for unsupported function... It shouldn't impact the normal flow |
yanavlasov
left a comment
There was a problem hiding this comment.
Will review the rest later today.
lambdai
left a comment
There was a problem hiding this comment.
Updating commit at my earliest availability today
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
|
@antoniovicente Sorry for the late reply! I am ramping up with the works left over. I dontn't merge master but making it mergeable. You can still review the new commits as you did before. |
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
|
@antoniovicente |
| bytes_written += slices[i].len_; | ||
| } | ||
| } | ||
| writable_peer_->setNewDataAvailable(); |
There was a problem hiding this comment.
This call should be omitted if the buffer was not empty at the beginning of this method. We're looking for edge trigger behavior, no need to notify of new data if there was data in the buffer prior to the writev call.
UserSpaceFileEventImpl provides 3 functions setEnabled(events) declared by FileEvent. The events are registered for callback. Each call detects fired events once, and IO handle will notify the new events in the long run. activate(events). Explicitly activate the events. The above enabling events are not honored. poll(events). It should only be used by IO handle. Unlike activate, poll honors the setEnabled. Will schedule callback if there is no pending callback. Part of #13418 Signed-off-by: Yuchen Dai <[email protected]>
|
Needs main merge |
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
Signed-off-by: Yuchen Dai <[email protected]>
|
Merged main branch and newly update API |
Signed-off-by: Yuchen Dai <[email protected]>
|
/wait |
|
I think this change is the same as #14917 Please close this PR. |
|
Thank you @antoniovicente ! |
Close in favor of #14712 and #14917
Commit Message:
Introduce BufferedIoSocketHandleImpl and UserSpaceFileEventImpl.
This socket handle owns the buffer for itself to read data from and for the peer to write to.
UserSpaceFileEventImpl is the FileEvent this socket could work with.
UserSpaceFileEventImpl provides 3 functions
eventsare registered for callback. Each call detects fired events once, and IO handle will notify the new events in the long run.activate, poll honors thesetEnabled.The BufferedIoSocketHandleImpl work with ConnectionImpl, and TcpListenerFilter
fdDoNotUseThe high level socket option should be intercepted by ConnectionSocketinstead of accessing the fd.
Will provide the example of
ConnectionImplandConnectionSocketin the next PR.Additional Description:
Extracted from #13361
Risk Level: Low. Production is not using this socket.
Testing: Added unit test.
Docs Changes: N/A
Release Notes: N/A