Exemplo n.º 1
0
func sendResponse(c net.Conn, resp *o.TaskResponse) {
	//FIXME: update retry time on Response
	o.Debug("Sending Response!")
	ptr := resp.Encode()
	p, err := o.Encode(ptr)
	o.MightFail(err, "Failed to encode response")
	_, err = p.Send(c)
	if err != nil {
		o.Warn("Transmission error: %s", err)
		c.Close()
		prequeueResponse(resp)
		lostConnection <- 1
	} else {
		appendUnacknowledgedResponse(resp)
	}
}
Exemplo n.º 2
0
func appendUnacknowledgedResponse(resp *o.TaskResponse) {
	resp.RetryTime = time.Nanoseconds() + RetryDelay
	unacknowledgedQueue.PushBack(resp)
}