title: Socket connection using utl_tcp
body: <p>How can i find the number of sockets open using utl_tcp.
  Using below code i am able to get response form the server but  i want to use multithreading pls let me know if there is any tool or utility or how can i update my code to find how many threads are supported by the server on the port.</p>
  
  <pre><code>create or replace 
  PROCEDURE KLMestk11 IS
   bt_conn               utl_tcp.CONNECTION;
   retval                binary_integer;
   l_sequence            varchar2(250) := ' 1235kl5pl70406mnbv78000000013121310000051                000000850910334640000524126927082700000000009000000000000000000mkp29112013*TESTING                              *T000000000000057007760847T000000000000057007760847T0000000057007760847';
   l_sequence1           varchar2(250) := ' 1235kl5pl70406mnbv78000000013121310000052                000000850910334640000524126927082700000000009000000000000000000mkp29112013*TESTING                              *T000000000000057007760847T000000000000057007760847T0000000057007760847';
   l_sequence2           varchar2(250) := ' 1235kl5pl70406mnbv78000000013121310000053                000000970910334640000524126927082700000000009000000000000000000mkp29112013*TESTING                              *T000000000000057007760847T000000000000057007760847T0000000057007760847';
   l_sequence3           varchar2(250) := ' 1235kl5pl70406mnbv78000000013121310000054                000000850910334640000524126927082700000000009000000000000000000mkp29112013*TESTING                              *T000000000000057007760847T000000000000057007760847T0000000057007760847';
   l_sequence4           varchar2(250) := ' 1235kl5pl70406mnbv78000000013121310000055                000000850910334640000524126927082700000000009000000000000000000mkp29112013*TESTING                              *T000000000000057007760847T000000000000057007760847T0000000057007760847';
   s_time                TIMESTAMP;
   e_time                TIMESTAMP;
  BEGIN
   s_time := CURRENT_TIMESTAMP;
   dbms_output.put_line('Start Time:'||s_time);
   bt_conn := utl_tcp.open_connection(remote_host =&gt; '50.0.16.901'
                                     ,remote_port =&gt; 5423
                                     ,tx_timeout =&gt; 1
                                     );
  
   retval := utl_tcp.write_line(bt_conn,l_sequence);
   dbms_output.put_line(utl_tcp.get_line(bt_conn, TRUE));
   utl_tcp.FLUSH(bt_conn);
   utl_tcp.close_connection(bt_conn);
  
   bt_conn := utl_tcp.open_connection(remote_host =&gt; '50.0.16.901'
                                     ,remote_port =&gt; 5423
                                     ,tx_timeout =&gt; 1
                                     );
   retval := utl_tcp.write_line(bt_conn,l_sequence1);
   dbms_output.put_line(utl_tcp.get_line(bt_conn, TRUE));
   utl_tcp.FLUSH(bt_conn);
   utl_tcp.close_connection(bt_conn);
  
   bt_conn := utl_tcp.open_connection(remote_host =&gt; '50.0.16.901'
                                     ,remote_port =&gt; 5423
                                     ,tx_timeout =&gt; 1
                                     );
   retval := utl_tcp.write_line(bt_conn,l_sequence4);
   dbms_output.put_line(utl_tcp.get_line(bt_conn, TRUE));
   e_time := CURRENT_TIMESTAMP;
   dbms_output.put_line('End Time:'||e_time);
   dbms_output.put_line('Duration:'||timestamp_diff(s_time,e_time));
   utl_tcp.FLUSH(bt_conn);
   utl_tcp.close_connection(bt_conn);
  EXCEPTION
   WHEN others THEN
    raise_application_error(-20101, sqlerrm);
    utl_tcp.close_connection(bt_conn);
  END;
  </code></pre>