Introduce configurable buffer size

This commit is contained in:
Jan Dittberner 2020-04-20 22:01:06 +02:00
parent 9924771531
commit 0bb19ba8bd
4 changed files with 23 additions and 5 deletions

View file

@ -46,7 +46,13 @@ func main() {
responseChannel := make(chan *datastructures.SignerResponse, 1)
readWriteCloser := (io.ReadWriteCloser)(port)
protocolHandler := protocol.NewProtocolHandler(requestChannel, &responseChannel, &readWriteCloser)
clientProtocolConfig := protocol.NewSignerProtocolConfig()
if clientConfig.BufferSize != 0 {
clientProtocolConfig.BufferSize = int(clientConfig.BufferSize)
}
protocolHandler := protocol.NewProtocolHandler(
requestChannel, &responseChannel, &readWriteCloser, clientProtocolConfig,
)
cancelChannel := make(chan os.Signal, 1)
signal.Notify(cancelChannel, syscall.SIGTERM, syscall.SIGINT)