Пример #1
0
func (s *Session) XsriptOpen() {
	xfer := s.transfer
	param := s.parameter

	fileName := tsunami.MakeTranscriptFileName(param.epoch, "tsus")

	f, err := os.OpenFile(fileName, os.O_WRONLY|os.O_CREATE, 0)
	if err != nil {
		fmt.Println("Could not create transcript file")
		return
	}
	xfer.transcript = f

	/* write out all the header information */

	fmt.Fprintln(f, "filename =", xfer.filename)
	fmt.Fprintln(f, "file_size =", param.file_size)
	fmt.Fprintln(f, "block_count =", param.block_count)
	fmt.Fprintln(f, "udp_buffer =", param.udp_buffer)
	fmt.Fprintln(f, "block_size =", param.block_size)
	fmt.Fprintln(f, "target_rate =", param.target_rate)
	fmt.Fprintln(f, "error_rate =", param.error_rate)
	fmt.Fprintln(f, "slower_num =", param.slower_num)
	fmt.Fprintln(f, "slower_den =", param.slower_den)
	fmt.Fprintln(f, "faster_num =", param.faster_num)
	fmt.Fprintln(f, "faster_den =", param.faster_den)
	fmt.Fprintln(f, "ipd_time =", param.ipd_time)
	fmt.Fprintln(f, "ipd_current =", xfer.ipd_current)
	fmt.Fprintln(f, "protocol_version =", tsunami.PROTOCOL_REVISION)
	fmt.Fprintln(f, "software_version =", tsunami.TSUNAMI_CVS_BUILDNR)
	fmt.Fprintln(f, "ipv6 =", param.ipv6)
	fmt.Fprintln(f)
	f.Sync()
}
Пример #2
0
func (s *Session) XsriptOpen() {
	xfer := s.tr
	param := s.param

	fileName := tsunami.MakeTranscriptFileName(time.Now(), "tsuc")

	f, err := os.OpenFile(fileName, os.O_WRONLY|os.O_CREATE, 0)
	if err != nil {
		fmt.Println("Could not create transcript file")
		return
	}
	xfer.transcript = f

	/* write out all the header information */

	fmt.Fprintln(f, "remote_filename =", xfer.remoteFileName)
	fmt.Fprintln(f, "local_filename =", xfer.localFileName)
	fmt.Fprintln(f, "file_size =", xfer.fileSize)
	fmt.Fprintln(f, "block_count =", xfer.blockCount)
	fmt.Fprintln(f, "udp_buffer =", param.udpBuffer)
	fmt.Fprintln(f, "block_size =", param.blockSize)
	fmt.Fprintln(f, "target_rate =", param.targetRate)
	fmt.Fprintln(f, "error_rate =", param.errorRate)
	fmt.Fprintln(f, "slower_num =", param.slowerNum)
	fmt.Fprintln(f, "slower_den =", param.slowerDen)
	fmt.Fprintln(f, "faster_num =", param.fasterNum)
	fmt.Fprintln(f, "faster_den =", param.fasterDen)
	fmt.Fprintln(f, "history =", param.history)
	fmt.Fprintln(f, "lossless =", param.lossless)
	fmt.Fprintln(f, "losswindow =", param.losswindow_ms)
	fmt.Fprintln(f, "blockdump =", param.blockDump)
	fmt.Fprintln(f, "update_period =", tsunami.UPDATE_PERIOD)
	fmt.Fprintln(f, "rexmit_period = ", tsunami.UPDATE_PERIOD)
	fmt.Fprintln(f, "protocol_version", tsunami.PROTOCOL_REVISION)
	fmt.Fprintln(f, "software_version =", tsunami.TSUNAMI_CVS_BUILDNR)
	fmt.Fprintln(f, "ipv6 =", param.ipv6)
	fmt.Fprintln(f)
	f.Sync()
}