私はLinuxから.net webserviceをPerl(5.8.7)を使って呼び出しています。 私はSOAP :: Liteライブラリを使用しています。SOAP :: Liteはfiledescriptorを取りますが、それを解放しません
概念の基本的な証明はうまくいきました。今では、Webサービスを何度も呼び出さなければならない現実世界で試しています。今度は、Webサービス呼び出しがファイルをオープンするが、ファイル記述子を解放しないように見える。使用可能なデフォルトの最大数は256に設定されていますが、それ以降はすぐにプログラムが終了します。私はLS -l/procの/ $$/fdに使用されるファイルディスクリプタを監視する場合
# Create the soap client
my $client = SOAP::Lite->new;
# Get raw SOAP xml output
$client->outputxml(1);
# Set connection parameters
$client->uri($namespace);
# set the url in the proxy member. The keep_alive parameter is needed if user authentication
# is used, it is passed on to the user agent class to set up an authenticated HTTP session
$client->proxy($url, keep_alive => 1);
# Set the user credentials
$client->transport->credentials("$host:$port", ''
, $user
, $password
);
# define the webservice method
$client->on_action(sub { return "$namespace$method" });
my $soapmethod = SOAP::Data->name($method)
->attr({xmlns => $namespace});
# Generate the SOAP parameters and make the call
my @paramarray = (\%paramhash);
my $ps = ${MakeSoapParameters(\@paramarray)};
# output the current number of filedescriptors used for this process
system("ls -l /proc/$$/fd | wc -l");
# Make the call
my $result = $client->call($soapmethod => $ps);
# output the current number of filedescriptors used for this process AFTER the call
system("ls -l /proc/$$/fd | wc -l");
|トイレ-l私はすべてを上がるために使用されるファイル記述子の数に気づく::(
は、ここでは、コードです時間は、私は、Webサービスの呼び出しを行う。
任意のヘルプやヒントをいただければ幸いです。私はこれを簡単にテストするが、作成したSOAPオブジェクトを削除してみてください。または、ときにそれをので、関数内のコードをラップすることはできません
コンマを行頭に置いた人は何ですか? –
これはスクリプト全体ですか?どういうわけかどこかに居住していますか? –
あなたは、ファイル記述子があなたのクライアントが開いたままにしておくべきソケットだけではないと確信していますか? – innaM