Open-Source-Software-Entwicklung und Downloads

Browse Subversion Repository

Contents of /trunk/doc/en/html/macro/command/setsync.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3227 - (show annotations) (download) (as text)
Tue Mar 24 15:10:33 2009 UTC (15 years, 1 month ago) by maya
File MIME type: text/html
File size: 2736 byte(s)
CVS から SVN へ移行: 改行コードを LF から CR+LF へ変換
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6 <title>setsync</title>
7 <meta http-equiv="Content-Style-Type" content="text/css">
8 <link rel="stylesheet" href="../../style.css" type="text/css">
9 </head>
10
11 <body>
12
13
14 <h1>setsync</h1>
15
16 <p>
17 Sets the synchronous mode.
18 </p>
19
20 <pre class="macro-syntax">
21 setsync &lt;sync flag&gt;
22 </pre>
23
24 <h2>Remarks</h2>
25
26 <p>
27 Enters the synchronous communication mode if &lt;sync flag&gt; is non-zero, or enters the asynchronous communication mode if &lt;sync flag&gt; is zero.
28 </p>
29
30 <p>
31 Tera Term transfers received characters from the host to MACRO. MACRO stores the characters in the buffer.<br>
32 The character-reading commands, such as the "<a href="wait.html">wait</a>" command, read out the characters from the buffer.
33 </p>
34
35 <p>
36 Initially, MACRO is in the asynchronous mode. In this mode, the buffer may overflow if no character-reading command is executed for a long time, or the receiving speed is too fast.<br>
37 In the synchronous mode, the buffer never overflows. If the buffer becomes full, Tera Term stops receiving characters from the host and stops transferring them to MACRO. When the buffer regains enough space,Tera Term restarts receiving and transferring.<br>
38 Enter the synchronous mode only when it is necessary and re-enter the asynchronous mode when the synchronous operation is no longer needed.
39 </p>
40
41 <p>
42 For a macro operation, which requires reliability, something like processing lines of received characters without loss of data, you need to enter the synchronous mode. However, the synchronous mode makes Tera Term slow in speed of receiving characters and causes Tera Term freeze if no character-reading command is executed for a long time.<br>
43 On the other hand, a simple macro operation, such as auto login, works with almost no problem in the asynchronous mode, because the buffer size is large enough (16K bytes) and all received characters are processed by character-reading commands before the buffer overflows.
44 </p>
45
46 <div align="center">
47 <img src="image/setsync.png" width=720 height=540>
48 </div>
49
50 <p>
51 See also "<a href="flushrecv.html">flushrecv</a>" for clearing the buffer.
52 </p>
53 <h2>Example</h2>
54
55 <pre class="macro-example">
56 connect server
57 ; enter the synchronous mode
58 setsync 1
59 timeout = 60
60 waitln '+OK' '-ERR'
61
62 ; enter the asynchronous mode
63 setsync 0
64
65 end
66 </pre>
67
68
69 <pre class="macro-example">
70 connect '/C=1'
71
72 setsync 1
73
74 while 1
75 ; Request data
76 sendln 'REQ'
77
78 ; Delay for 1 second
79 pause 1
80
81 flushrecv
82 endwhile
83 </pre>
84
85
86 </body>
87 </html>

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26