Add conversion functions for writePoolData#1014
Add conversion functions for writePoolData#1014koalabearguo wants to merge 1 commit intogorilla:mainfrom
Conversation
Because writePoolData is not export,so it can not config WriteBufferPool field in Upgrader and Dialer Signed-off-by: koala <koalabearguo@gmail.com>
|
Explain the situation where you need to know the type of the value in the pool. Based on the documentation, the type is intentionally hidden. |
|
the writePoolData struct is not exported,so when impl BufferPool interface Get/Put,it can not return writePoolData type. the bellow code line 517 use the writePoolData in conn.go ,it will translate the interface fail。 |
|
Maybe you can give a demo for using BufferPool in Upgrader and Dialer,I can not run progam normal. |
|
The pool implication stores values with type A trivial implementation with a pool size of of one is: Notice that the pool does not need to know the type of the value. |
|
Thanks for getting back to me. I use the bellow code to initial my program as you mentioned. but in conn.go bellow,the ok var is false forever,it forever log the "Error.........",the pool is not used! |
|
ok,my program has only one byte pool,I dont want websocket to new byteslice,maybe i can manage bytepool outside the websocket package so this is my requirement,i need conversion functions for writePoolData,just new byteslice outside the package |
|
Two things:
|
|
ok,i see. now i can use it local.so it dose not matter thanks again. |
Because writePoolData is not export,so it can not config WriteBufferPool field in Upgrader and Dialer
What type of PR is this? (check all applicable)
Description
Related Tickets & Documents
Added/updated tests?
have not been included
Run verifications and test
make verifyis passingmake testis passing