Log: [*****] BUG: close_socket closing desc 0 on 1023
Comm: Bob has quit.
SWGI:
}
compressEnd( dclose );
if( dclose->descriptor == maxdesc )
–maxdesc;
if( dclose->auth_fd != -1 )
close( dclose->auth_fd ); //1023
free_desc( dclose );
–num_descriptors;
return;
}
SMAUGFUSS:
}
compressEnd( dclose );
if( dclose->descriptor == maxdesc )
–maxdesc;
free_desc( dclose );
–num_descriptors;
return;
}
To summarize:
I noticed when I'd connect to my MUD(Modified SWR1.0FUSS), I was not getting a greeting or any output, even after typing things in. I'd log in anyway and notice in another window that I was logged in, but still would receive no input in Window 1. I checked send_to_desc_color() and added a bug() for a null d->descriptor, and found out that d->descriptor was being set to 0 by accept() in comm.cpp.
A few things to note are:
1) Wikipedia says that a value of 0 is input, 1 is output, and 2 is error. I noticed that on booting a fresh copy of my MUD, I usually get a descriptor of 4+, but it usually starts assigning at 8.
2) At some point, it decides it wants to assign a descriptor of 0. Since I removed the call in send_to_desc_color() to return on a 0 descriptor, they can connect and play the MUD successfully, however, at some point, that person will be randomly disconnected later. I'm assuming this is because 0 should not be assigned.
3) This article claims that any value above -1 should be accepted, however, why am I receiving a 0 at some instances and >=4 everywhere else?
I have no knowledge of low level socket libraries and I know some of you are quite familiar with them, specifically accept(), so any information into fixing this issue, whether it is an issue at all, would be appreciated.