sock->meas = 0;
sock->recv_ok = 1;
sock->valid = 1;
+ sock->moredata = 0;
sock->sd = -1;
sock->port = -1;
XBT_IN;
VERB1("Close %p",sock);
+ if (sock == _gras_lastly_selected_socket) {
+ if (sock->moredata)
+ CRITICAL0("Closing a socket which had another message buffered after the one being handled now. Go fix your code.");
+ _gras_lastly_selected_socket=NULL;
+ }
+
/* FIXME: Issue an event when the socket is closed */
if (sock) {
xbt_dynar_foreach(sockets,cursor,sock_iter) {