|
@ -53,10 +53,10 @@ func handleRequests(app types.Application, connClosed chan struct{}, conn net.Co |
|
|
var count int |
|
|
var count int |
|
|
var bufReader = bufio.NewReader(conn) |
|
|
var bufReader = bufio.NewReader(conn) |
|
|
for { |
|
|
for { |
|
|
var n int64 |
|
|
|
|
|
|
|
|
var n int |
|
|
var err error |
|
|
var err error |
|
|
var req types.Request |
|
|
var req types.Request |
|
|
wire.ReadBinaryPtr(&req, bufReader, &n, &err) |
|
|
|
|
|
|
|
|
wire.ReadBinaryPtr(&req, bufReader, 0, &n, &err) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
fmt.Println("Error in handleRequests:", err.Error()) |
|
|
fmt.Println("Error in handleRequests:", err.Error()) |
|
|
connClosed <- struct{}{} |
|
|
connClosed <- struct{}{} |
|
@ -119,7 +119,7 @@ func handleResponses(connClosed chan struct{}, responses <-chan types.Response, |
|
|
var bufWriter = bufio.NewWriter(conn) |
|
|
var bufWriter = bufio.NewWriter(conn) |
|
|
for { |
|
|
for { |
|
|
var res = <-responses |
|
|
var res = <-responses |
|
|
var n int64 |
|
|
|
|
|
|
|
|
var n int |
|
|
var err error |
|
|
var err error |
|
|
wire.WriteBinary(res, bufWriter, &n, &err) |
|
|
wire.WriteBinary(res, bufWriter, &n, &err) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|