
  PROCEDURE [INLINE] nlp$sk_tcp_ret_send_task_entry
    (VAR tcp_connection: ^nlt$tcp_socket_layer;
     VAR sender_task: ^nlt$tcp_sender_task);

?? PUSH (LISTEXT := ON) ??

    VAR
      pool_entry: ^nlt$tcp_sender_task,
      pool_size: integer;

    IF tcp_connection^.state = nlc$tcp_conn_open THEN
      sender_task^.next_entry := NIL;
      IF tcp_connection^.available_sender_pool = NIL THEN
        tcp_connection^.available_sender_pool := sender_task;
      ELSE { calculate pool size
        pool_size := 1;
        pool_entry := tcp_connection^.available_sender_pool;
        WHILE pool_entry^.next_entry <> NIL DO
          pool_entry := pool_entry^.next_entry;
          pool_size := pool_size + 1;
        WHILEND;
        IF pool_size < nlc$tcp_max_pool_size THEN
          pool_entry^.next_entry := sender_task;
        ELSE
          FREE sender_task IN nav$network_paged_heap^;
        IFEND;
      IFEND;
      sender_task := NIL;
    ELSE { tcp connection closed or terminated
      FREE sender_task IN nav$network_paged_heap^;
    IFEND;

  PROCEND nlp$sk_tcp_ret_send_task_entry;

*copy nlh$sk_tcp_ret_send_task_entry

*copyc nav$network_paged_heap
*copyc nlc$tcp_max_pool_size
*copyc nlt$tcp_sender_task
*copyc nlt$tcp_socket_layer
?? POP ??
