Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
Sockets[Peek] - ソケット上のデータに対するチェック
使い方
Peek(sid)
パラメータ
sid - 有効な開かれたソケット ID
説明
デフォルトでは、ソケット上での読み込み操作は、データが利用可能となるまでブロックされます。手続き Peek では、ソケット上でのデータの存在を調べることができます。この機能は、 Sockets[Read], Sockets[ReadLine] または Sockets[ReadBinary] を呼び出す際に、timeouts の使用を避けるのに役立ちます。
手続き Peek は、値 false または文字列のいずれかが直ちに返されたときには、ブロックを行いません。
Peek が呼び出されると、データを読むことなしに、ソケット上で利用可能なデータからサンプルを抽出します。サンプルとなったデータを含む文字列が、返されます。同じデータが、 Sockets[Read], Sockets[ReadLine] または Sockets[ReadBinary] に対する次のコールで利用可能となるでしょう。ソケット上に利用可能なデータがない場合には、値 false が返されます。
例
with( Sockets ): sid := Open( "vulcan", "echo" ): Write( sid, "Sample data" ): Peek( sid );
Read( sid );
Peek( sid );
Write( sid, "Sample data" ): while Peek( sid ) <> false do Read( sid ) od;
Close( sid );
参照
用語集 - socket, Sockets パッケージの紹介, Sockets[Read], Sockets[ReadLine], Sockets[ReadBinary], 持続中断のプロトコルと Sockets パッケージ
Download Help Document