示例#1
0
func (s *VirStream) Finish() error {
	result := C.virStreamFinish(s.ptr)
	if result < 0 {
		return errors.New(GetLastError())
	}
	return nil
}
示例#2
0
func (v *VirStream) Close() error {
	result := C.virStreamFinish(v.ptr)
	if result == -1 {
		return GetLastError()
	}

	return nil
}
示例#3
0
// Finish indicates that there is no further data to be transmitted on the
// stream. For output streams this should be called once all data has been
// written. For input streams this should be called once Recv returns
// end-of-file.
// This method is a synchronization point for all asynchronous errors, so if
// this returns a success code the application can be sure that all data has
// been successfully processed.
func (str Stream) Finish() error {
	str.log.Println("finishing stream...")
	cRet := C.virStreamFinish(str.virStream)
	ret := int32(cRet)

	if ret == -1 {
		err := LastError()
		str.log.Printf("an error occurred: %v\n", err)
		return err
	}

	str.log.Println("stream finished")

	return nil
}