@@ -83,20 +83,23 @@ pub struct Recv<T: IoBufMut, S> {
8383 pub ( crate ) fd : S ,
8484 pub ( crate ) buffer : T ,
8585 pub ( crate ) flags : RecvFlags ,
86+ poll_first : bool ,
8687}
8788
8889/// Receive data from remote into vectored buffer.
8990pub struct RecvVectored < T : IoVectoredBufMut , S > {
9091 pub ( crate ) fd : S ,
9192 pub ( crate ) buffer : T ,
9293 pub ( crate ) flags : RecvFlags ,
94+ poll_first : bool ,
9395}
9496
9597pub ( crate ) struct RecvFromHeader < S > {
9698 pub ( crate ) fd : S ,
9799 pub ( crate ) flags : RecvFlags ,
98100 pub ( crate ) addr : SockAddrStorage ,
99101 pub ( crate ) addr_len : socklen_t ,
102+ poll_first : bool ,
100103}
101104
102105/// Receive data and source address.
@@ -118,6 +121,7 @@ pub struct RecvMsg<T: IoVectoredBufMut, C: IoBufMut, S> {
118121 pub ( crate ) buffer : T ,
119122 pub ( crate ) control : C ,
120123 pub ( crate ) control_len : usize ,
124+ poll_first : bool ,
121125}
122126
123127impl < S > Connect < S > {
@@ -254,8 +258,15 @@ impl<T: IoVectoredBufMut, C: IoBufMut, S> RecvMsg<T, C, S> {
254258 buffer,
255259 control,
256260 control_len : 0 ,
261+ poll_first : false ,
257262 }
258263 }
264+
265+ /// This method sets the `IORING_RECVSEND_POLL_FIRST` flag in the `ioprio`
266+ /// of the SQE on the IO_URING driver.
267+ pub fn poll_first ( & mut self ) {
268+ self . poll_first = true ;
269+ }
259270}
260271
261272impl < T : IoVectoredBufMut , C : IoBufMut , S > IntoInner for RecvMsg < T , C , S > {
@@ -273,7 +284,18 @@ impl<T: IoVectoredBufMut, C: IoBufMut, S> IntoInner for RecvMsg<T, C, S> {
273284impl < T : IoBufMut , S > Recv < T , S > {
274285 /// Create [`Recv`].
275286 pub fn new ( fd : S , buffer : T , flags : RecvFlags ) -> Self {
276- Self { fd, buffer, flags }
287+ Self {
288+ fd,
289+ buffer,
290+ flags,
291+ poll_first : false ,
292+ }
293+ }
294+
295+ /// This method sets the `IORING_RECVSEND_POLL_FIRST` flag in the `ioprio`
296+ /// of the SQE on the IO_URING driver.
297+ pub fn poll_first ( & mut self ) {
298+ self . poll_first = true ;
277299 }
278300}
279301
@@ -288,7 +310,18 @@ impl<T: IoBufMut, S> IntoInner for Recv<T, S> {
288310impl < T : IoVectoredBufMut , S > RecvVectored < T , S > {
289311 /// Create [`RecvVectored`].
290312 pub fn new ( fd : S , buffer : T , flags : RecvFlags ) -> Self {
291- Self { fd, buffer, flags }
313+ Self {
314+ fd,
315+ buffer,
316+ flags,
317+ poll_first : false ,
318+ }
319+ }
320+
321+ /// This method sets the `IORING_RECVSEND_POLL_FIRST` flag in the `ioprio`
322+ /// of the SQE on the IO_URING driver.
323+ pub fn poll_first ( & mut self ) {
324+ self . poll_first = true ;
292325 }
293326}
294327
@@ -309,6 +342,7 @@ impl<S> RecvFromHeader<S> {
309342 addr,
310343 flags,
311344 addr_len : name_len,
345+ poll_first : false ,
312346 }
313347 }
314348
@@ -325,6 +359,12 @@ impl<T: IoVectoredBufMut, S> RecvFromVectored<T, S> {
325359 buffer,
326360 }
327361 }
362+
363+ /// This method sets the `IORING_RECVSEND_POLL_FIRST` flag in the `ioprio`
364+ /// of the SQE on the IO_URING driver.
365+ pub fn poll_first ( & mut self ) {
366+ self . header . poll_first = true ;
367+ }
328368}
329369
330370impl < T : IoVectoredBufMut , S : AsFd > IntoInner for RecvFromVectored < T , S > {
@@ -344,6 +384,12 @@ impl<T: IoBufMut, S> RecvFrom<T, S> {
344384 buffer,
345385 }
346386 }
387+
388+ /// This method sets the `IORING_RECVSEND_POLL_FIRST` flag in the `ioprio`
389+ /// of the SQE on the IO_URING driver.
390+ pub fn poll_first ( & mut self ) {
391+ self . header . poll_first = true ;
392+ }
347393}
348394
349395impl < T : IoBufMut , S > IntoInner for RecvFrom < T , S > {
0 commit comments