localclose()

localclose()

概要

実装

  713: void
  714: localclose(Conv *s, char *reason)        /*  called with tcb locked */
  715: {
  716:         Tcpctl *tcb;
  717:         Reseq *rp,*rp1;
  718:         Tcppriv *tpriv;
  719: 
  720:         tpriv = s->p->priv;
  721:         tcb = (Tcpctl*)s->ptcl;
  722: 
  723:         iphtrem(&tpriv->ht, s);
  • 詳細はiphtrem()?を参照
  724: 
  725:         tcphalt(tpriv, &tcb->timer);
  726:         tcphalt(tpriv, &tcb->rtt_timer);
  727:         tcphalt(tpriv, &tcb->acktimer);
  728:         tcphalt(tpriv, &tcb->katimer);
  729: 
  730:         /* Flush reassembly queue; nothing more can arrive */
  731:         for(rp = tcb->reseq; rp != nil; rp = rp1) {
  732:                 rp1 = rp->next;
  733:                 freeblist(rp->bp);
  734:                 free(rp);
  735:         }
  736:         tcb->reseq = nil;
  737: 
  738:         if(tcb->state == Syn_sent)
  739:                 Fsconnected(s, reason);
  740:         if(s->state == Announced)
  741:                 wakeup(&s->listenr);
  742: 
  743:         qhangup(s->rq, reason);
  744:         qhangup(s->wq, reason);
  745: 
  746:         tcpsetstate(s, Closed);
  747: }