txdv / LibuvSharp

.NET bindings for libuv
176 stars 41 forks source link

Multiple connections use single CopyingByteBufferAllocator instances? #18

Open beetlex-io opened 7 years ago

beetlex-io commented 7 years ago

UVStream

ByteBufferAllocatorBase allocator; public ByteBufferAllocatorBase ByteBufferAllocator { get { return allocator ?? Loop.ByteBufferAllocator; } set { allocator = value; } } public void Resume() { CheckDisposed(); int r = uv_read_start(NativeHandle, ByteBufferAllocator.AllocCallback, read_cb); Ensure.Success(r); }

txdv commented 7 years ago

Yeah they do, you can assign your own bytebufferallocator, for every handler and loop.

This one just creates a new buffer and copies the contents to it, so everyone can use it.