senddata();
if(s.state == STATE_CLOSE) { s.state = STATE_NORMAL; uip_close();
DISPATCHER_UIPCALL(telnetd_app, ts){  if(uip_connected()) {    dispatcher_markconn(uip_conn, &s);    for(i = 0; i < NUMLINES; ++i) {      s.lines[i] = NULL;    }    s.bufptr = 0;    shell_output("Contiki remote command shell", "");    shell_output("Type '?' for help", "");    senddata();    return;  }    if(uip_closed()) {    shell_output("Connection closed", "");  }    if(uip_aborted()) {    shell_output("Connection reset", "");    /*    aborted();*/  }    if(uip_timedout()) {    shell_output("Connection timed out", "");  }    if(uip_acked()) {    acked();  }    if(uip_newdata()) {    newdata();  }    if(uip_rexmit() ||     uip_newdata() ||     uip_acked()) {    senddata();  } else if(uip_poll()) {        senddata();  }}