Some of the NetStreams
objects use constants or key names where address families, protocols
or other settings must be specified. To simplify the usage of the
library it supports not only numerical constants, but also key names
for the same purposes. This is easier to remember and easier to use.
Additional reason is that some constants have different values on
different platforms while the key names string constants are the same
on each platform.
Note that the names are case-sensitive!
Address family
Address family |
Numeric |
Key name |
IPv4 (Internet) |
2 |
"AF_INET" |
IRDA |
26 (Win)/22
(WinCE) |
"AF_IRDA" |
IPv6 |
23 |
"AF_INET6" |
Socket type
Socket type |
Numeric |
Key name |
stream (connection
oriented) |
1 |
"SOCK_STREAM" |
datagram |
2 |
"SOCK_DGRAM" |
Sub-Protocol
Protocol |
Numeric |
Key name |
Unspecified (not
applicable) |
0 |
"" |
TCP |
6 |
"IPPROTO_TCP" |
UDP |
17 |
"IPPROTO_UDP" |
Level |
Numeric |
Key name |
Socket level |
&HFFFF |
"SOL_SOCKET" |
IP - TCP protocol |
6 |
"IPPROTO_TCP" |
IRLMP (Infrared) |
&H00FF |
"SOL_IRLMP" |
Option types
Option |
Level to which applies |
Numeric |
Key name |
Value type |
r - readable
w - writable |
Broadcast socket |
SOL_SOCKET |
&H0020 |
"SO_BROADCAST" |
Boolean |
r/w |
Debug mode |
SOL_SOCKET |
&H0001 |
"SO_DEBUG" |
Boolean |
r/w |
Do not linger |
SOL_SOCKET |
&HFF7F |
"SO_DONTLINGER" |
Boolean |
r/w |
Keep alive |
SOL_SOCKET |
&H0008 |
"SO_KEEPALIVE" |
Boolean |
r/w |
OOB inline |
SOL_SOCKET |
&H0100 |
"SO_OOBINLINE" |
Boolean |
r/w |
Receive
buffer size |
SOL_SOCKET |
&H1002 |
"SO_RCVBUF" |
Long |
r |
Reuse address |
SOL_SOCKET |
&H0004 |
"SO_REUSEADDR" |
Boolean |
r/w |
Write
buffer size |
SOL_SOCKET |
&H1001 |
"SO_SNDBUF" |
Long |
r |
Enumerate IR devices |
SOL_IRLMP |
&0010 |
"IRLMP_ENUMDEVICES" |
IRDADeviceInfo |
r |
Socket is listening |
SOL_SOCKET |
&H0002 |
"SO_ACCEPTCONN" |
Bolean |
r |
Max send msg. size |
SOL_SOCKET |
&H2003 |
"SO_MAX_MSG_SIZE" |
Long |
r |
Don't route |
SOL_SOCKET |
&H0010 |
"SO_DONTROUTE" |
Boolean |
r/w |
Send timeout |
SOL_SOCKET |
&H1005 |
"SO_SNDTIMEO" |
Long |
r/w |
Receive timeout |
SOL_SOCKET |
&H1006 |
"SO_RCVTIMEO" |
Long |
r/w |
|
Supported on all
platforms |
|
Not currently
supported on Windows 95/98/ME |
|
May not work on
some platforms |
|