Re: recvfrom



On Sun, 12 Nov 2006 11:01:00 +0100, ¬a\/b wrote:
dg_SndRcv:
< b, c, r, i, j, k
s-=256
<< @ibuf=[s+284], @ilen=[s+288], @obuf=[s+292], @olen=[s+296]
<< @fd=[s+300], @destAdd=[s+304], @destLen=[s+308], @Pint3A=[s+312]
<< @t=[k], @c=[k+4], @delta=[k+8]
i=@obuf; k=@Pint3A; D[s+24]=5; D[s+16]=0;
D @ibuf==0#.e; i==0#.e;
D @destAdd==0!#.a| D @destLen!=0#.e; #.b;
.a: D @destLen<0 ?#.e;
.b: b=@fd; b==-1#.e; D @ilen<=0?#.e; D @olen<0?#.e;
k!#.e; j=@t; D[s+32]=j; #.1;
.e: a=-1; stc; ##.f;
.1: D @t!=0!#.2
c=@c; c==@delta!#.2 /* aggiorna il timer per velocita'
D @t=0; D @c=0; j=0; /* maggiori ogni "delta" pacchetti
D @delta>50#.2; D @delta <<= 1; /* delta cresce
all'inizio
.2: a=@olen; r=@destAdd; c=@destLen; i=@obuf;
sendto(b, i, a, 0, r, c); a!=@olen#.e;
D[s+16]#.3;
c=@ilen; r=@ibuf; a=s;

it should be better a=&[s+100]; because GetExitCodeThread use esp

*a=b; D[a+4]=r; D[a+8]=c; i=&[a+12];
// dg_threadf(a); a!#.3; ##.7;
CreateThread(0, 0, dg_threadf, a, 0, i);
a==0#.e; [s+16]=a;
.3: j=@t;
.4: a=@t; Sleep(a);
a=[s+16]; c=s; GetExitCodeThread(a, c); a==0#.ee;
D*s!=STILL_ACTIVE!#.9
a=[s+32]; @t=a; ++D @c;
a=[s+64]; clc; #.f; /* in s+64 there is the len recived

a=[s+100+16]; clc; #.f


/* 0r, 4r, 8c, 12b, 16ra, 20P_a
dg_threadf:
< b, c, r, r
a=[s+20]; b=*a; r=[a+4]; c=[a+8];
c!=508!#.0; a=c; ##.2;
.0: D*s=" V:"; a=s; _P<(a);
D*s="%d ";
a=s; _P<(a, b); /* _P is printf
a=s; _P<(a, c);
a=s; _P<(a, r);
D*s="| "; a=s; _P<(a);
recvfrom(b, r, c, 0, 0, 0);
a==SOCKET_ERROR!#.1| a=-1; #.2;
.1: b=[s+20]; D[b+64]=a; /* in s+64 the len
^^^^^^^^^^
D[b+16]=a;

a=0;
.2: // < a|Sleep(10000)|> a
b, c, r, r
ret 4 /* notare come non utilizzi il parametro che gli passano


but there is someone that can understand?
.