File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -114,9 +114,11 @@ impl Conn for DTLSConn {
114
114
async fn connect ( & self , _addr : SocketAddr ) -> UtilResult < ( ) > {
115
115
Err ( util:: Error :: Other ( "Not applicable" . to_owned ( ) ) )
116
116
}
117
+
117
118
async fn recv ( & self , buf : & mut [ u8 ] ) -> UtilResult < usize > {
118
119
self . read ( buf, None ) . await . map_err ( util:: Error :: from_std)
119
120
}
121
+
120
122
async fn recv_from ( & self , buf : & mut [ u8 ] ) -> UtilResult < ( usize , SocketAddr ) > {
121
123
if let Some ( raddr) = self . conn . remote_addr ( ) {
122
124
let n = self . read ( buf, None ) . await . map_err ( util:: Error :: from_std) ?;
@@ -127,18 +129,23 @@ impl Conn for DTLSConn {
127
129
) )
128
130
}
129
131
}
132
+
130
133
async fn send ( & self , buf : & [ u8 ] ) -> UtilResult < usize > {
131
134
self . write ( buf, None ) . await . map_err ( util:: Error :: from_std)
132
135
}
136
+
133
137
async fn send_to ( & self , _buf : & [ u8 ] , _target : SocketAddr ) -> UtilResult < usize > {
134
138
Err ( util:: Error :: Other ( "Not applicable" . to_owned ( ) ) )
135
139
}
140
+
136
141
fn local_addr ( & self ) -> UtilResult < SocketAddr > {
137
142
self . conn . local_addr ( )
138
143
}
144
+
139
145
fn remote_addr ( & self ) -> Option < SocketAddr > {
140
146
self . conn . remote_addr ( )
141
147
}
148
+
142
149
async fn close ( & self ) -> UtilResult < ( ) > {
143
150
self . close ( ) . await . map_err ( util:: Error :: from_std)
144
151
}
You can’t perform that action at this time.
0 commit comments