@dom96, you are the author of async libraries, don't you? Maybe you can help me 
with it. Here is my experiments with it: 
[https://github.com/vegansk/Nim/tree/async_buffers](https://github.com/vegansk/Nim/tree/async_buffers).
 I don't want to create the PR right now. Here is the problem. The tests works 
on windows, when I implement `send` via `sendBuffer`: 
[https://github.com/vegansk/Nim/blob/async_buffers/lib/pure/asyncdispatch.nim#L865](https://github.com/vegansk/Nim/blob/async_buffers/lib/pure/asyncdispatch.nim#L865).
 But it fails on Linux in tests/async/tasyncawait.nim if I implement `send` 
like this:
    
    
    proc send*(socket: AsyncFD, data: string,
                 flags = {SocketFlag.SafeDisconn}): Future[void] =
        ## Sends ``data`` to ``socket``. The returned future will complete once 
all
        ## data has been sent.
        var c = data
        socket.sendBuffer(addr c[0], data.len, flags)
    
    

and when I copy `sendBuffer`'s body, to `send` 
([https://github.com/vegansk/Nim/blob/async_buffers/lib/pure/asyncdispatch.nim#L1464](https://github.com/vegansk/Nim/blob/async_buffers/lib/pure/asyncdispatch.nim#L1464))
 it's just works. 

Reply via email to