@@ -0,0 +1,231 | |||||
|
1 | title ='MST-ISR 2009 (NS-Up)' | |||
|
2 | ||||
|
3 | #Experiments = 12 | |||
|
4 | ||||
|
5 | 1 = | |||
|
6 | [[0.5,0.5,0.5,0.5,1.5,0.5,0.5,0.5],$ | |||
|
7 | [2.0,1.0,1.0,1.0,3.0,1.0,1.0,1.0],$ | |||
|
8 | [0.0,0.5,0.5,0.5,0.0,0.5,0.5,0.5],$ | |||
|
9 | [3.5,0.5,0.5,0.5,2.5,0.5,0.5,0.5],$ | |||
|
10 | [1.0,1.0,1.0,1.0,1.0,2.0,3.0,0.0],$ | |||
|
11 | [0.5,0.5,0.5,1.0,2.0,3.0,0.0,1.0],$ | |||
|
12 | [1.0,1.0,1.0,1.0,3.0,0.0,1.0,2.0],$ | |||
|
13 | [0.5,0.5,0.5,0.5,0.0,1.0,2.0,3.0]] | |||
|
14 | ||||
|
15 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
16 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
17 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
18 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
19 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
20 | [0.5,0.5,0.5,1.0,1.0,1.0,1.0,1.0],$ | |||
|
21 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
22 | [0.5,0.5,0.5,0.5,1.0,1.0,1.0,1.0]] | |||
|
23 | ||||
|
24 | 2 = | |||
|
25 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
26 | [1.0,1.0,1.0,0.0,1.0,1.0,1.0,1.0],$ | |||
|
27 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
28 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
29 | [1.0,1.0,1.0,1.0,2.0,3.0,0.0,1.0],$ | |||
|
30 | [0.5,0.5,0.5,1.0,3.0,0.0,1.0,2.0],$ | |||
|
31 | [1.0,1.0,1.0,1.0,0.0,1.0,2.0,3.0],$ | |||
|
32 | [0.5,0.5,0.5,0.5,1.0,2.0,3.0,0.0]] | |||
|
33 | ||||
|
34 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
35 | [1.0,1.0,0.0,0.0,1.0,1.0,1.0,1.0],$ | |||
|
36 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
37 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
38 | [1.0,1.0,1.0,1.0,2.0,2.0,2.0,2.0],$ | |||
|
39 | [0.5,0.5,0.5,1.0,2.0,2.0,2.0,2.0],$ | |||
|
40 | [1.0,1.0,1.0,1.0,2.0,2.0,2.0,2.0],$ | |||
|
41 | [0.5,0.5,0.5,0.5,2.0,2.0,2.0,2.0]] | |||
|
42 | ||||
|
43 | 3 = | |||
|
44 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
45 | [1.0,1.0,0.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
46 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
47 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
48 | [1.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0],$ | |||
|
49 | [0.5,0.5,0.5,1.0,3.0,3.0,3.0,3.0],$ | |||
|
50 | [1.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0],$ | |||
|
51 | [0.5,0.5,0.5,0.5,3.0,3.0,3.0,3.0]] | |||
|
52 | ||||
|
53 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
54 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
55 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
56 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
57 | [1.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0],$ | |||
|
58 | [0.5,0.5,0.5,1.0,3.0,3.0,3.0,3.0],$ | |||
|
59 | [1.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0],$ | |||
|
60 | [0.5,0.5,0.5,0.5,3.0,3.0,3.0,3.0]] | |||
|
61 | ||||
|
62 | 4 = | |||
|
63 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
64 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
65 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
66 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
67 | [1.0,1.0,1.0,1.0,0.0,1.0,2.0,3.0],$ | |||
|
68 | [0.5,0.5,0.5,1.0,1.0,2.0,3.0,0.0],$ | |||
|
69 | [1.0,1.0,1.0,1.0,2.0,3.0,0.0,1.0],$ | |||
|
70 | [0.5,0.5,0.5,0.5,3.0,0.0,1.0,2.0]] | |||
|
71 | ||||
|
72 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
73 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
74 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
75 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
76 | [1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0],$ | |||
|
77 | [0.5,0.5,0.5,1.0,0.0,0.0,0.0,0.0],$ | |||
|
78 | [1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0],$ | |||
|
79 | [0.5,0.5,0.5,0.5,0.0,0.0,0.0,0.0]] | |||
|
80 | ||||
|
81 | 5 = | |||
|
82 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
83 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
84 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
85 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
86 | [1.0,1.0,1.0,1.0,0.5,1.5,2.5,3.5],$ | |||
|
87 | [0.5,0.5,0.5,1.0,1.5,2.5,3.5,0.5],$ | |||
|
88 | [1.0,1.0,1.0,1.0,2.5,3.5,0.5,1.5],$ | |||
|
89 | [0.5,0.5,0.5,0.5,3.5,0.5,1.5,2.5]] | |||
|
90 | ||||
|
91 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
92 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
93 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
94 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
95 | [1.0,1.0,1.0,1.0,0.5,0.5,0.5,0.5],$ | |||
|
96 | [0.5,0.5,0.5,1.0,0.5,0.5,0.5,0.5],$ | |||
|
97 | [1.0,1.0,1.0,1.0,0.5,0.5,0.5,0.5],$ | |||
|
98 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]] | |||
|
99 | ||||
|
100 | 6= | |||
|
101 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
102 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
103 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
104 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
105 | [1.0,1.0,1.0,1.0,1.5,1.5,1.5,1.5],$ | |||
|
106 | [0.5,0.5,0.5,1.0,1.5,1.5,1.5,1.5],$ | |||
|
107 | [1.0,1.0,1.0,1.0,1.5,1.5,1.5,1.5],$ | |||
|
108 | [0.5,0.5,0.5,0.5,1.5,1.5,1.5,1.5]] | |||
|
109 | ||||
|
110 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
111 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
112 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
113 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
114 | [1.0,1.0,1.0,1.0,1.5,1.5,1.5,1.5],$ | |||
|
115 | [0.5,0.5,0.5,1.0,1.5,1.5,1.5,1.5],$ | |||
|
116 | [1.0,1.0,1.0,1.0,1.5,1.5,1.5,1.5],$ | |||
|
117 | [0.5,0.5,0.5,0.5,1.5,1.5,1.5,1.5]] | |||
|
118 | ||||
|
119 | 7 = | |||
|
120 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
121 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
122 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
123 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
124 | [1.0,1.0,1.0,1.0,2.5,2.5,2.5,2.5],$ | |||
|
125 | [0.5,0.5,0.5,1.0,2.5,2.5,2.5,2.5],$ | |||
|
126 | [1.0,1.0,1.0,1.0,2.5,2.5,2.5,2.5],$ | |||
|
127 | [0.5,0.5,0.5,0.5,2.5,2.5,2.5,2.5]] | |||
|
128 | ||||
|
129 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
130 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
131 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
132 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
133 | [1.0,1.0,1.0,1.0,2.5,2.5,2.5,2.5],$ | |||
|
134 | [0.5,0.5,0.5,1.0,2.5,2.5,2.5,2.5],$ | |||
|
135 | [1.0,1.0,1.0,1.0,2.5,2.5,2.5,2.5],$ | |||
|
136 | [0.5,0.5,0.5,0.5,2.5,2.5,2.5,2.5]] | |||
|
137 | 8 = | |||
|
No newline at end of file | ||||
|
138 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
139 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
140 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
141 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
142 | [1.0,1.0,1.0,1.0,3.5,3.5,3.5,3.5],$ | |||
|
143 | [0.5,0.5,0.5,1.0,3.5,3.5,3.5,3.5],$ | |||
|
144 | [1.0,1.0,1.0,1.0,3.5,3.5,3.5,3.5],$ | |||
|
145 | [0.5,0.5,0.5,0.5,3.5,3.5,3.5,3.5]] | |||
|
146 | ||||
|
147 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
148 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
149 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
150 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
151 | [1.0,1.0,1.0,1.0,3.5,3.5,3.5,3.5],$ | |||
|
152 | [0.5,0.5,0.5,1.0,3.5,3.5,3.5,3.5],$ | |||
|
153 | [1.0,1.0,1.0,1.0,3.5,3.5,3.5,3.5],$ | |||
|
154 | [0.5,0.5,0.5,0.5,3.5,3.5,3.5,3.5]] | |||
|
155 | ||||
|
156 | 9 = | |||
|
157 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
158 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
159 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
160 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
161 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
162 | [0.5,0.5,0.5,1.0,1.0,1.0,1.0,1.0],$ | |||
|
163 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
164 | [0.5,0.5,0.5,0.5,1.0,1.0,1.0,1.0]] | |||
|
165 | ||||
|
166 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
167 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
168 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
169 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
170 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
171 | [0.5,0.5,0.5,1.0,1.0,1.0,1.0,1.0],$ | |||
|
172 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
173 | [0.5,0.5,0.5,0.5,1.0,1.0,1.0,1.0]] | |||
|
174 | ||||
|
175 | 10 = | |||
|
176 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
177 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
178 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
179 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
180 | [1.0,1.0,1.0,1.0,2.0,2.0,2.0,2.0],$ | |||
|
181 | [0.5,0.5,0.5,1.0,2.0,2.0,2.0,2.0],$ | |||
|
182 | [1.0,1.0,1.0,1.0,2.0,2.0,2.0,2.0],$ | |||
|
183 | [0.5,0.5,0.5,0.5,2.0,2.0,2.0,2.0]] | |||
|
184 | ||||
|
185 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
186 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
187 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
188 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
189 | [1.0,1.0,1.0,1.0,2.0,2.0,2.0,2.0],$ | |||
|
190 | [0.5,0.5,0.5,1.0,2.0,2.0,2.0,2.0],$ | |||
|
191 | [1.0,1.0,1.0,1.0,2.0,2.0,2.0,2.0],$ | |||
|
192 | [0.5,0.5,0.5,0.5,2.0,2.0,2.0,2.0]] | |||
|
193 | ||||
|
194 | 11 = | |||
|
195 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
196 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
197 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
198 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
199 | [1.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0],$ | |||
|
200 | [0.5,0.5,0.5,1.0,3.0,3.0,3.0,3.0],$ | |||
|
201 | [1.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0],$ | |||
|
202 | [0.5,0.5,0.5,0.5,3.0,3.0,3.0,3.0]] | |||
|
203 | ||||
|
204 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
205 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
206 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
207 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
208 | [1.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0],$ | |||
|
209 | [0.5,0.5,0.5,1.0,3.0,3.0,3.0,3.0],$ | |||
|
210 | [1.0,1.0,1.0,1.0,3.0,3.0,3.0,3.0],$ | |||
|
211 | [0.5,0.5,0.5,0.5,3.0,3.0,3.0,3.0]] | |||
|
212 | ||||
|
213 | 12 = | |||
|
214 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
215 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
216 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
217 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
218 | [1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0],$ | |||
|
219 | [0.5,0.5,0.5,1.0,0.0,0.0,0.0,0.0],$ | |||
|
220 | [1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0],$ | |||
|
221 | [0.5,0.5,0.5,0.5,0.0,0.0,0.0,0.0]] | |||
|
222 | ||||
|
223 | [[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
224 | [1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],$ | |||
|
225 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
226 | [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],$ | |||
|
227 | [1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0],$ | |||
|
228 | [0.5,0.5,0.5,1.0,0.0,0.0,0.0,0.0],$ | |||
|
229 | [1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0],$ | |||
|
230 | [0.5,0.5,0.5,0.5,0.0,0.0,0.0,0.0]] | |||
|
231 |
@@ -1,14 +1,75 | |||||
1 |
import socket |
|
1 | import socket | |
|
2 | import string | |||
|
3 | #import time | |||
2 |
|
4 | |||
3 | host = "192.168.1.100" |
|
5 | def int2bin(n): | |
4 | s = socket.socket() |
|
6 | n_hex = "%x" %n | |
|
7 | ln = len(n_hex) | |||
|
8 | if ln == 1: | |||
|
9 | n_hex = "00000" + n_hex | |||
|
10 | elif ln == 2: | |||
|
11 | n_hex = "0000" + n_hex | |||
|
12 | elif ln == 3: | |||
|
13 | n_hex = "000" + n_hex | |||
|
14 | elif ln == 4: | |||
|
15 | n_hex = "00" + n_hex | |||
|
16 | elif ln == 5: | |||
|
17 | n_hex = "0" + n_hex | |||
|
18 | ||||
|
19 | byte1 = n_hex[0:2] | |||
|
20 | byte2 = n_hex[2:4] | |||
|
21 | byte3 = n_hex[4:6] | |||
|
22 | str_len = "" | |||
|
23 | str_len += "%c" % string.atoi(byte1,16) | |||
|
24 | str_len += "%c" % string.atoi(byte2,16) | |||
|
25 | str_len += "%c" % string.atoi(byte3,16) | |||
|
26 | ||||
|
27 | return str_len | |||
|
28 | ||||
|
29 | #ini = time.time() | |||
|
30 | #sum = 0 | |||
|
31 | ||||
|
32 | #for i in range(11,15): | |||
|
33 | i=117 | |||
|
34 | #ini1 = time.time() | |||
|
35 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |||
|
36 | host = "192.168.1." + str(i) | |||
5 | s.connect((host, 5500)) |
|
37 | s.connect((host, 5500)) | |
|
38 | ||||
|
39 | fd = open("experimento1.abs","r") | |||
|
40 | FileList = fd.readlines() | |||
|
41 | data = "".join(FileList) | |||
6 |
|
42 | |||
7 | fd = open("input3.txt","r") |
|
43 | dfl = 0 | |
8 | FileList = fd.readlines() |
|
44 | lng = int2bin(dfl) | |
9 | mensaje = "".join(FileList) |
|
45 | msg = "jro" + "abs" + "src" + "cm1" + lng + "cmd" + data + "crc" # | |
10 | s.send(mensaje) |
|
46 | print len(msg) | |
|
47 | print msg | |||
11 |
|
48 | |||
12 | print "adios" |
|
49 | lmsg = len(msg) | |
13 |
|
50 | lng = int2bin(lmsg) | ||
14 | s.close() No newline at end of file |
|
51 | ||
|
52 | msg = "jro" + "abs" + "src" + "cm1" + lng + "cmd" + data + "crc" # | |||
|
53 | print len(msg) | |||
|
54 | print msg | |||
|
55 | ||||
|
56 | total_len = len(msg) + 3 | |||
|
57 | ||||
|
58 | s.send(mensaje) | |||
|
59 | #recibido = s.recv(512) | |||
|
60 | ||||
|
61 | print recibido | |||
|
62 | ||||
|
63 | s.close() | |||
|
64 | ||||
|
65 | ||||
|
66 | # delay = time.time() - ini1 | |||
|
67 | # sum += delay | |||
|
68 | # print delay | |||
|
69 | # time.sleep(0.1) | |||
|
70 | ||||
|
71 | #print sum | |||
|
72 | ||||
|
73 | ||||
|
74 | ||||
|
75 | No newline at end of file |
@@ -1,7 +1,7 | |||||
1 | import socket |
|
1 | import socket | |
2 | import time |
|
2 | import time | |
3 |
|
3 | |||
4 |
host = "192.168.1.1 |
|
4 | host = "192.168.1.117" | |
5 | s = socket.socket() |
|
5 | s = socket.socket() | |
6 | s.bind((host, 5500)) |
|
6 | s.bind((host, 5500)) | |
7 |
|
7 | |||
@@ -12,11 +12,24 | |||||
12 | sc, addr = s.accept() |
|
12 | sc, addr = s.accept() | |
13 |
|
13 | |||
14 | all = "" |
|
14 | all = "" | |
|
15 | # while True: | |||
|
16 | # recibido = sc.recv(1024) | |||
|
17 | # all = all + recibido | |||
|
18 | # if all[-4:] == "quit": | |||
|
19 | # break | |||
|
20 | cnt = 0; | |||
15 | while True: |
|
21 | while True: | |
16 | recibido = sc.recv(1024) |
|
22 | recibido = sc.recv(1024) | |
17 | all = all + recibido |
|
23 | if len(recibido) == 1024: | |
18 | if all[-4:] == "quit": |
|
24 | all = all + recibido | |
|
25 | else: | |||
|
26 | all = recibido | |||
|
27 | ||||
|
28 | cnt = cnt + len(all) | |||
|
29 | if cnt == 1024: | |||
19 | break |
|
30 | break | |
|
31 | ||||
|
32 | ||||
20 |
|
33 | |||
21 | print "\nTotal:", all |
|
34 | print "\nTotal:", all | |
22 | print "\nLongitud:", len(all) |
|
35 | print "\nLongitud:", len(all) |
General Comments 0
You need to be logged in to leave comments.
Login now