POE-0.26 > POE::Driver

名前

POE::Driver - an abstract file driver

POE::Driver - アブストラクトファイルドライバ

概要

  $driver = POE::Driver::Something->new();
  $arrayref_of_data_chunks = $driver->get($filehandle);
  $queue_octets = $driver->put($arrayref_of_data_chunks);
  $queue_octets = $driver->flush($filehandle);
  $queue_messages = $driver->get_out_messages_buffered();

説明

Drivers implement generic interfaces to low-level file I/O. Wheels use them to read and write files, sockets, and other things without needing to know the details for doing so.

ドライバは低レベルのファイルI/Oとの一般的なインターフェースを実装します。 ホイールはそれらを使用して読み書きの詳細を知る必要無しにファイル、ソケ ット、その他のものを読み書きします。

PUBLIC DRIVER METHODS

These methods are the generic Driver interface, and every driver must implement them. Specific drivers may have additional methods.

これらのメソッドは一般的なDriverインターフェースであり、全てのドライバ はこれらを実装しなければなりません。具体的なドライバはさらに他のメソッ ドを持つかもしれません。

new

new() creates and initializes a new driver. Specific drivers may have different constructor parameters.

new()は新しいドライバを生成し初期化します。具体的なドライバは異なったコ ンストラクタ引数を持つかもしれません。

get FILEHANDLE

get() immediately tries to read information from a filehandle. It returns a reference to an array containing whatever it managed to read, or an empty array if nothing could be read. It returns undef on error, and $! will be set.

get()は直ちにファイルハンドルから情報を読むことを試みます。何とかして読 んだものを含んだ配列へのリファレンスを返すか、あるいは何も読むことがで きなかった場合は空の配列を返します。エラーの場合はundefを返し、$!が設定 されるでしょう。

The arrayref get() returns is suitable for passing to any POE::Filter's get() method. This is exactly what the ReadWrite wheel does with it.

get()が返す配列リファレンスはあらゆるPOE::Filterのget()メソッドに渡すた めに適切な形をしています。これはまさしくReadWriteホイールが行うことその ものです。

put ARRAYREF

put() places raw data chunks into the driver's output queue. it accepts a reference to a list of raw data chunks, and it returns the number of octets remaining in its output queue.

put()は生のデータチャンクをドライバの出力キューに置きます。生のデータチ ャンクのリストへのリファレンスを受け付け、出力キューに残っているオクテ ット数を返します。

Some drivers may flush data immediately from their put() methods.

put()メソッドの直後にデータをフラッシュするドライバもあるかもしれません。

flush FILEHANDLE

flush() attempts to flush some data from the driver's output queue to the FILEHANDLE. It returns the number of octets remaining in the output queue after the flush attempt.

flush()はドライバの出力キューのデータをいくらかFILEHANDLEにフラッシュし ようと試みます。フラッシュを試みた後に出力キューに残っているオクテット 数を返します。

flush() does the physical write, counterpoint to get's read. If flush() fails for any reason, $! will be set with the reason for its failure. Otherwise $! will be zero.

getの読み込みと対照的に、flush()は物理的な書き込みを行います。もしflush ()が何らかの理由で失敗すると、失敗の理由が$!に設定されるでしょう。さも なければ$!はゼロになります。

get_out_messages_buffered

This data accessor returns the number of messages in the driver's output queue. Partial messages are counted as whole ones.

このデータアクセサはドライバの出力キューにあるメッセージ数を返します。 メッセージの一部分は完全な一つとして数えられます。

SEE ALSO

The SEE ALSO section in POE contains a table of contents covering the entire POE distribution.

POEのSEE ALSOセクションがPOEのディストリビューション全体をカバーする 目次を含んでいます。

バグ

There is no POE::Driver::SendRecv, but nobody has needed one so far.

POE::Driver::SendRecvはありませんが、今のところ誰も必要としていません。

In theory, drivers should be pretty much interchangeable. In practice, there seems to be an impermeable barrier between the different SOCK_* types.

理論上は、ドライバはまさに置き換え可能であるべきです。実際には、異なっ たSOCK_*タイプの間には通り抜けられない障壁があるようです。

AUTHORS & COPYRIGHTS

Please see POE for more information about authors and contributors.

作者と貢献者についての詳しい情報はPOEを参照してください。

Translators

井上 謙次 <deq@oct.zaq.ne.jp>