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[WriteBinary] - ソケット接続へのバイナリデータの書き込み
使い方
WriteBinary(sid, a)
パラメータ
sid - ソケット接続を表すソケット ID
a - hardware データ型の rtable
説明
Maple の文字列はデータのエンコードができないため、ソケット接続上にバイナリデータを書き込む際に、手続き Sockets[Write] を使用することはできません。そこで、ソケット接続に対してバイナリデータを送ることが可能な、インタフェース WriteBinary が用意されています。
1 つめの引数は、データが書き込まれる、有効な開かれたソケット ID sid を表します。2 つめの引数は、ソケット接続に対して書き込みを行いたいデータを含む、hardware データ型の rtable a を表します。
rtable a に添え字付きの関数を使用することはできません。また rtable a は、rectangular ストレージを持つ必要があります。rtable は、以下のハードウェアデータ型のいずれかを持ちます:
integer[ 1 ] integer[ 2 ] integer[ 4 ] integer[ 8 ] float[ 4 ] float[ 8 ]
a の datatype が integer[1] 以外のものである場合には、データは構造として取り扱われ、各 "record" は、ソケットへの書き込みを行う前に Network Byte Order に変換されます。
実際にソケットへ書き込まれたデータのバイト数は、Maple の(非負の)整数として返されます。
例
with( Sockets ): sid := Open( "deneb", "echo" );
a := Array( convert( "Hello", 'bytes' ), 'datatype' = 'integer'[ 1 ] );
WriteBinary( sid, a );
Read( sid );
Close( sid );
参照
rtable, 用語集 - socket, Sockets パッケージの紹介, Sockets[ReadBinary], Sockets[Write]
Download Help Document