![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Section contents
csocket.oxh
The Inet address class is derived from the socket address class.
Class | SockAddr | InetAddr |
---|---|---|
Methods | CmpPort Family Port SetFamily SetPort |
Address Cast CmpAddr Input IsClassA IsClassB IsClassC IsClassBroadcast IsClassMulticast IsClassWildAddr IsClassWildPort Match MatchMask Net NetBroadcast NetMask Output SetAddress SubNet SubNetBroadcast |
this& = NewInetAddr&:
<TBS>
this& |
A handle which represents the created inet address object |
If the object could not be created then an error is generated
which should be trapped by an ONERR
handler.
LOCAL this& this& = NewInetAddr&: DeleteInetAddr:(this&)
this& = NewInetAddr2&:(address&)
Creates a new Inet Address obhject from and existing address object.
address& |
A handle to a socket address object (or an object derived from a socket address object) |
this& |
A handle which represents the created inet address object |
If the object could not be created then an error is generated
which should be trapped by an ONERR
handler.
LOCAL this&, addr& addr& = NewInetAddr4&:(INET_ADDR&:(192,10,1,5),KEchoPort&) this& = NewInetAddr2&:(addr&) DeleteInetAddr:(this&)
this& = NewInetAddr3&:(port&)
<TBS>
port& |
Specifies the port for the address |
this& |
A handle which represents the created inet address object |
If the object could not be created then an error is generated
which should be trapped by an ONERR
handler.
CONST KEchoPort& = 7 LOCAL this& this& = NewInetAddr3&:(KEchoPort&) DeleteInetAddr:(this&)
this&xi = NewInetAddr4&:(inetAddr&,port&)
<TBS>
inetAddr& |
<TBS> |
port& |
<TBS> |
this& |
A handle which represents the created inet address object |
If the object could not be created then an error is generated
which should be trapped by an ONERR
handler.
CONST KEchoPort& = 7 LOCAL this& this& = NewInetAddr4&:(INET_ADDR&:(192,10,1,5),KEchoPort&) DeleteInetAddr:(this&)
DeleteInetAddr:(BYREF this&)
Destroys the internet address object.
BYREF this& |
A handle for an internet address object. A zero value is written back into the variable |
LOCAL this$ this& = NewInetAddr&: DeleteInetAddr:(this&)
address& = InetAddrAddress&:(this&)
Returns a long integer value which represents the internet address.
this& |
A handle for an internet address object |
address& |
An integer value which represents the internet address |
address& = InetAddrCast&:(addr&)
<TBS>
addr& |
A handle for an internet address object |
address& |
A handle for a socket address object |
result% = InetAddrCmpAddress%:(this&,inetAddr&)
<TBS>
this& |
A handle for an internet address object |
inetAddr& |
A handle for an internet address object |
result% |
<TBS> |
result% = InetAddrInput%:(this&,string$)
Attempts to convert the characters in string$ into a valid address. Allows conversion of strings of the form a, a.b, a.b.c, a.b.c.d, or 0xaabbccdd.
this& |
A handle for an internet address object |
string$ |
A string containing the address |
result% |
Set to KNoError% if the address is successfully converted |
LOCAL this& LOCAL result% this& = NewInetAddr&: result% = InetAddrInput%:(this&,"127.0.0.1") IF result%<0 PRINT "Unable to Input address: "; result% ELSE PRINT InetAddrOutput$:(this&) ENDIF DeleteInetAddr:(this&)
result% = InetAddrIsClassA%:(this&)
Checks the address and returns TRUE (-1) if it is a Class A network address. A Class A network address is one whose first byte is in the range 0 to 128. In a Class A address the first byte is the network number and the next three bytes are the host address.
this& |
A handle for an internet address object |
result% |
Set to -1 if the address belongs to a Class A network, otherwise set to 0 |
LOCAL this& LOCAL result% this& = NewInetAddr2&:(INET_ADDR(192,10,1,5)) IF InetAddrIsClassA%:(this&) PRINT InetAddrOutput$:(this&); " is a class A network address" ELSE PRINT InetAddrOutput$:(this&); " is not a class A network address" ENDIF DeleteInetAddr:(this&)
result% = InetAddrIsClassB%:(this&)
Checks the address and returns TRUE (-1) if it is a Class B network address. A Class B network address is one whose first byte is in the range 128 to 191. In a Class B address the first two bytes identify the network and the next two bytes identify the host.
this& |
A handle for an internet address object |
result% |
Set to -1 if the address belongs to a Class B network, otherwise set to 0 |
LOCAL this& LOCAL result% this& = NewInetAddr2&:(INET_ADDR(192,10,1,5)) IF InetAddrIsClassB%:(this&) PRINT InetAddrOutput$:(this&); " is a class B network address" ELSE PRINT InetAddrOutput$:(this&); " is not a class B network address" ENDIF DeleteInetAddr:(this&)
result% = InetAddrIsClassBroadcast%:(this&)
Checks the address and returns TRUE (-1) if it is 255.255.255.255.
this& |
A handle for an internet address object |
result% |
Set to -1 if the address is 255.255.255.255, otherwise set to 0 |
result% = InetAddrIsClassC%:(this&)
Checks the address and returns TRUE (-1) if it is a Class C network address. A Class C network address is one whose first byte is in the range 192 to 223. In a Class C address the first three bytes identify the network and the last bytes identifies the host.
this& |
A handle for an internet address object |
result% |
Set to -1 if the address belong to a Class C network, otherwise set to 0 |
LOCAL this& LOCAL result% this& = NewInetAddr2&:(INET_ADDR(192,10,1,5)) IF InetAddrIsClassC%:(this&) PRINT InetAddrOutput$:(this&); " is a class C network address" ELSE PRINT InetAddrOutput$:(this&); " is not a class C network address" ENDIF DeleteInetAddr:(this&)
result% = InetAddrIsClassMulticast%:(this&)
<TBS>
this& |
A handle for an internet address object |
result% |
Set to -1 if the address is a multicast address, otherwise set to 0 |
result% = InetAddrIsClassWildAddr%:(this&)
<TBS>
this& |
A handle for an internet address object |
result% |
Set to -1 if the address is 0.0.0.0, otherwise set to 0 |
result% = InetAddrIsClassWildPort%:(this&)
<TBS>
this& |
A handle for an internet address object |
result% |
Set to -1 if the port is 0, otherwise set to 0 |
result% = InetAddrMatch%:(this&,inetAddr&)
<TBS>
this& |
A handle for an internet address object |
inetAddr& |
A handle for an internet address object |
result% |
<TBS> |
result% = InetAddrMatchMask%:(this&,inetAddr&,mask&)
<TBS>
this& |
A handle for an internet address object |
inetAddr& |
A handle for an internet address object |
mask& |
<TBS> |
result% |
<TBS> |
InetAddrNet:(this&,inetAddr&)
<TBS>
this& |
A handle for an internet address object |
inetAddr& |
A handle for an internet address object |
InetAddrNetBroadcast:(this&,inetAddr&)
<TBS>
this& |
A handle for an internet address object |
inetAddr& |
A handle for an internet address object |
InetAddrNetMask:(this&,inetAddr&)
<TBS>
this& |
A handle for an internet address object |
inetAddr& |
A handle for an internet address object |
string$ = InetAddrOutput$:(this&)
Converts the internal address representation to a string.
this& |
A handle for an internet address object |
string$ |
A string representation of the address |
LOCAL this& LOCAL result% this& = NewInetAddr&: result% = InetAddrInput%:(this&,"127.0.0.1") IF result%<0 PRINT "Unable to Input address: "; result% ELSE PRINT InetAddrOutput$:(this&) ENDIF DeleteInetAddr:(this&)
InetAddrSetAddress:(this&,inetAddr&)
<TBS>
this& |
A handle for an internet address object |
inetAddr& |
A handle for an internet address object |
LOCAL this& this& = NewInetAddr&: InetAddrSetAddress:(this&,INET_ADDR&:(192,10,1,5)) PRINT InetAddrOutput$:(this&) DeleteInetAddr:(this&)
InetAddrSubNet:(this&,inetAddr&)
<TBS>
this& |
A handle for an internet address object |
inetAddr& |
A handle for an internet address object |
InetAddrSubNetBroadcast:(this&,inetAddr&)
<TBS>
this& |
A handle for an internet address object |
inetAddr& |
A handle for an internet address object |
ipaddress&xi = INET_ADDR&:(val1%,val2%,val3%,val4%)
Combines the four parameters into a single long integer.
val1% |
The first byte of the address |
val2% |
The second byte of the address |
val3% |
The third byte of the address |
val4% |
The fourth byte of the address |
ipaddress& |
A long integer which represents the Internet address |
LOCAL this& this& = NewInetAddr2&:(INET_ADDR(192,10,1,5)) DeleteInetAddr:(this&)
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |