-/* $Id: fd.js,v 1.10 2006/08/22 13:47:18 mmondor Exp $ */
+/* $Id: fd.js,v 1.11 2006/08/22 14:08:45 mmondor Exp $ */
/*
* Copyright (C) 2006, Matthew Mondor
try {
len = this.write(data);
if (len < 1) {
+ this.events &= ~FD.POLLOUT;
this.berror = this.BERROR;
return -1;
}
} catch (x) {
if (this.errno != Errno.EAGAIN) {
+ this.events &= ~FD.POLLOUT;
this.berror = this.BERROR;
return -1;
}
}
- if (len == data.length)
+ if (len == data.length) {
+ this.events &= ~FD.POLLOUT;
return 0;
+ }
this.bwrite_buffer += data.substr(len);
/* FALLTHROUGH */
try {
len = this.write(this.bwrite_buffer);
if (len < 1) {
+ this.events &= ~FD.POLLOUT;
this.berror = this.BERROR;
return -1;
}
} catch (x) {
if (this.errno != Errno.EAGAIN) {
+ this.events &= ~FD.POLLOUT;
this.berror = this.BERROR;
return -1;
}