@@ -172,7 +172,7 @@ pub async fn Client::send_close(
172172 true ,
173173 OpCode ::Close ,
174174 payload .unsafe_reinterpret_as_bytes (),
175- self .rand.int (). to_be_bytes (),
175+ @buffer . new ().. write_int_le ( self .rand.int ()). to_bytes (),
176176 )
177177 // Wait until the server acknowledges the close
178178 ignore (read_frame (self .conn)) catch {
@@ -193,7 +193,7 @@ pub async fn Client::send_text(self : Client, text : StringView) -> Unit {
193193 true ,
194194 OpCode ::Text ,
195195 payload ,
196- self .rand.int (). to_le_bytes (),
196+ @buffer . new ().. write_int_le ( self .rand.int ()). to_bytes (),
197197 )
198198}
199199
@@ -208,7 +208,7 @@ pub async fn Client::send_binary(self : Client, data : BytesView) -> Unit {
208208 true ,
209209 OpCode ::Binary ,
210210 data ,
211- self .rand.int (). to_le_bytes (),
211+ @buffer . new ().. write_int_le ( self .rand.int ()). to_bytes (),
212212 )
213213}
214214
@@ -226,7 +226,7 @@ async fn Client::_ping(self : Client, data? : Bytes = Bytes::new(0)) -> Unit {
226226 true ,
227227 OpCode ::Ping ,
228228 data ,
229- self .rand.int (). to_le_bytes (),
229+ @buffer . new ().. write_int_le ( self .rand.int ()). to_bytes (),
230230 )
231231}
232232
@@ -243,7 +243,7 @@ async fn Client::pong(self : Client, data? : Bytes = Bytes::new(0)) -> Unit {
243243 true ,
244244 OpCode ::Pong ,
245245 data ,
246- self .rand.int (). to_be_bytes (),
246+ @buffer . new ().. write_int_le ( self .rand.int ()). to_bytes (),
247247 )
248248}
249249
0 commit comments