~vcs-imports/junkcode/main

« back to all changes in this revision

Viewing changes to messaging/udp2.c

  • Committer: tridge
  • Date: 2007-05-26 08:29:21 UTC
  • Revision ID: vcs-imports@canonical.com-20070526082921-djzi1qk1jnvaynfx
demo dgram flood problem

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
        start_timer();
289
289
 
290
290
        while (1) {
291
 
                char c=0;
292
 
                if (write(s2, &c, 1) != 1) {
 
291
                char c[1];
 
292
                if (write(s2, c, sizeof(c)) != sizeof(c)) {
293
293
                        fatal("write");
294
294
                }
295
 
                if (read(s1, &c, 1) != 1) {
 
295
                if (read(s1, c, sizeof(c)) != sizeof(c)) {
296
296
                        fatal("read");
297
297
                }
298
298
                if (w == 1 && (end_timer() > 1.0)) {