(deviceID DeviceID, reader io.Reader, writer io.Writer, closer io.Closer, receiver rawModel, connInfo ConnectionInfo, compress Compression)
| 240 | } |
| 241 | |
| 242 | func newRawConnection(deviceID DeviceID, reader io.Reader, writer io.Writer, closer io.Closer, receiver rawModel, connInfo ConnectionInfo, compress Compression) *rawConnection { |
| 243 | idString := deviceID.String() |
| 244 | cr := &countingReader{Reader: reader, idString: idString} |
| 245 | cw := &countingWriter{Writer: writer, idString: idString} |
| 246 | registerDeviceMetrics(idString) |
| 247 | |
| 248 | return &rawConnection{ |
| 249 | ConnectionInfo: connInfo, |
| 250 | deviceID: deviceID, |
| 251 | idString: deviceID.String(), |
| 252 | model: receiver, |
| 253 | started: make(chan struct{}), |
| 254 | cr: cr, |
| 255 | cw: cw, |
| 256 | closer: closer, |
| 257 | awaiting: make(map[int]chan asyncResult), |
| 258 | inbox: make(chan proto.Message), |
| 259 | outbox: make(chan asyncMessage), |
| 260 | closeBox: make(chan asyncMessage), |
| 261 | clusterConfigBox: make(chan *ClusterConfig), |
| 262 | dispatcherLoopStopped: make(chan struct{}), |
| 263 | closed: make(chan struct{}), |
| 264 | compression: compress, |
| 265 | loopWG: sync.WaitGroup{}, |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | // Start creates the goroutines for sending and receiving of messages. It must |
| 270 | // be called once after creating a connection. It should only be called once, |
no test coverage detected