Fix 2013/mills + format/typo checks
The problem that was showing up is that one could connect and it would show the time once but then it would close the connection and be unable to connect again, showing an error in the browser. After looking at the code it became clear it is because the backlog to listen(2) was 1 and this is not enough for close(2) and then immediately listening again. I updated the bugs.md file too - added a feature, not a bug. The author notes that one cannot start the program right after termination and have the program successfully bind the socket. They did note the fix and it's well known (at least to those of us who are experienced in socket programming :-) ) but as it was documented it is a feature not a bug. It just means one has to wait for a few seconds (though 'few seconds' can vary). The README.md file has been format fixed.
This commit is contained in:
1 parent
c109cd23cc
commit
b157e5ddaf
3 files changed
+28
-4
No files matched your search
+1
-1
@@ -25,7 +25,7 @@ r(e-p-8); while(p!=e){ c^=*p++; for(j=0; 8>j; j++)c=c/2^c%2*3988292384; } r(~c);
|
||||
(); } void q(int c){ w(c); m+=c; m%=c=65521; n+=m; n%=c; } void T(F c){ c=.5+255
|
||||
*c; q(0>c?0:c>255?255:c); } struct sockaddr_in R; int main(){ time_t i; struct
|
||||
tm*b; R.win_port=8224; s=socket(R.sin_family=AF_INET,SOCK_STREAM,0); bind(s,
|
||||
(void*)&R, sizeof R); listen(s,1); for(; ; ){ k=accept(s,0,0); for(; ; ){ ++j;
|
||||
(void*)&R, sizeof R); listen(s,10); for(; ; ){ k=accept(s,0,0); for(; ; ){ ++j;
|
||||
read(k,p,1); if(*p=='\n') { if(3>j)break; j=0; } } m=1; u("\n\032\n\rGNP"
|
||||
"\211\n\r\n\r1 :hserfeR\n\rKO 002 0.1/PTTH"); Z("RDHI"); r(800); r(600); w
|
||||
(8); r(33554433); J(); Z(0); w(120); w(1); J(); i=time(0); b=localtime(&
|
||||
|
||||
Reference in new issue
Block a user