📄 streams.doc8.html
字号:
</td><td colspan=1 rowspan=1><div class="CellBody"><a name="86019" class="autotag"> </a>Receive a message from a datagram socket.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86021" class="autotag"> </a><b class="routine"><i class="routine">setsockopt</i></b><b>( )</b></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86023" class="autotag"> </a>Set socket options.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86025" class="autotag"> </a><b class="routine"><i class="routine">getsockopt</i></b><b>( )</b></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86027" class="autotag"> </a>Get socket options.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86029" class="autotag"> </a><b class="routine"><i class="routine">getsockname</i></b><b>( )</b></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86031" class="autotag"> </a>Get the name of a socket.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86033" class="autotag"> </a><b class="routine"><i class="routine">getpeername</i></b><b>( )</b></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86035" class="autotag"> </a>Get the name of a connected peer socket.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86037" class="autotag"> </a><b class="routine"><i class="routine">strmSockProtoAdd</i></b><b>( )</b></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86057" class="autotag"> </a>Add transport provider to STREAMS socket library.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86045" class="autotag"> </a><b class="routine"><i class="routine">read</i></b><b>( )</b></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86047" class="autotag"> </a>Read from a socket.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86049" class="autotag"> </a><b class="routine"><i class="routine">write</i></b><b>( )</b></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86051" class="autotag"> </a>Write to a socket.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86053" class="autotag"> </a><b class="routine"><i class="routine">ioctl</i></b><b>( )</b></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="86055" class="autotag"> </a>Perform control functions on a socket.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1></td><td colspan=1 rowspan=1></td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><p class="Body"><a name="85653" class="autotag"> </a>WindNet STREAMS sockets are compatible with the VxWorks BSD 4.3 interface. However, there are known differences between STREAMS sockets and BSD sockets. Those differences are listed in <a href="streams.doc8.html#85660"><i class="title">Table 3</i></a>. <p class="table"><h4 class="EntityTitle"><a name="85660" class="autotag"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 3. VxWorks Sockets Versus STREAMS Sockets</font></a></h4><table border="0" cellpadding="3" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="85666" class="autotag"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Subject</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="85668" class="autotag"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">BSD Sockets</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="85670" class="autotag"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">STREAMS Sockets</font></b></div></th></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"></th><th rowspan="1" colspan="1"></th><th rowspan="1" colspan="1"></th></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85678" class="autotag"> </a><b>FIONREAD</b> <i class="acronym_lc">ioctl</i></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85680" class="autotag"> </a><b>FIONREAD</b> <i class="acronym_lc">ioctl</i> returns the number of bytes available to be read, including any inline OOB (out-of-band) data.</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85682" class="autotag"> </a>This is a STREAMS issue. For example, SVR4 systems translate this <i class="acronym_lc">ioctl</i> into the STREAMS <b>I</b><b class="symbol_UC"> </b><b>NREAD</b> <i class="acronym_lc">ioctl</i>, which only reports the number of bytes in the first data message at the stream head. VxWorks supports the <b>FIONREAD</b> <i class="acronym_lc">ioctl </i>directly, so behavior is the same as for BSD sockets.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85684" class="autotag"> </a>Newly-arriving OOB (out-of-band) bytes </div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85686" class="autotag"> </a>If a marked byte is at the front of the read queue, a newly-arriving OOB byte does <i class="emphasis">not</i> clear the first mark. This behavior is inconsistent with the case when another marked byte is not at the front of the read queue.</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85688" class="autotag"> </a>A newly-arriving OOB byte always clears previous marked bytes, even at the front of the read queue.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85690" class="autotag"> </a>Marked bytes</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85692" class="autotag"> </a>When OOB data is inline, and the marked (OOB) byte is at the front of the read queue, and <font face="Palatino, serif"><i class="textVariable">n</i></font> bytes are read, the marked byte and <font face="Palatino, serif"><i class="textVariable">n</i></font>-1 bytes after it will be returned.</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85694" class="autotag"> </a>Marked bytes are in their own 1-byte message, so only the first marked byte is returned. This difference should never be seen by a "correctly written" application.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85696" class="autotag"> </a><b class="routine"><i class="routine">recv</i></b><b>( )</b> with the <b>MSG_PEEK</b> parameter<b></b></div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85698" class="autotag"> </a>The <b class="routine"><i class="routine">recv</i></b><b>( )</b> routine used with <b>MSG_PEEK</b> returns the lesser of the number of bytes requested and the number of bytes available up to any data mark.</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="85700" class="autotag"> </a>The <b class="routine"><i class="routine">recv</i></b><b>( )</b> routine with <b>MSG_PEEK</b> returns the number of bytes in the first message at the stream head.</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="85702" class="autotag"> </a><b class="routine"><i class="routine">write</i></b><b>( )</b></div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -