Back: TCP.Socket-stream protocol Up: TCP package Forward: TCP.SocketAddress class-abstract   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

6.15 TCP.SocketAddress

Defined in namespace TCP
Superclass: Object
Category: Sockets-Protocols

6.15.1 TCP.SocketAddress class: abstract  (class)
6.15.2 TCP.SocketAddress class: accessing  (class)
6.15.3 TCP.SocketAddress class: C call-outs  (class)
6.15.4 TCP.SocketAddress class: host name lookup  (class)
6.15.5 TCP.SocketAddress class: initialization  (class)
6.15.6 TCP.SocketAddress: accessing  (instance)


6.15.1 TCP.SocketAddress class: abstract

fromSockAddr: aByteArray port: portAdaptor
Private - Answer a new IPAddress from a ByteArray containing a C sockaddr structure. The portAdaptor's value is changed to contain the port that the structure refers to.


6.15.2 TCP.SocketAddress class: accessing

addressFamily
Answer the address family used for sockets whose endpoint is an instance of the receiver.

anyLocalAddress
Answer an IPAddress representing a local address.

at: host cache: aBlock
Private - Answer the list of addresses associated to the given host in the cache. If the host is not cached yet, evaluate aBlock and cache and answer the result.

defaultDatagramSocketImplClass
Answer the class that, by default, is used to map between the Socket's protocol and a low-level C interface.

defaultDatagramSocketImplClass: aClass
Set which class will be used by default to map between the receiver's protocol and a low-level C interface.

defaultRawSocketImplClass
Answer the class that, by default, is used to map between the Socket's protocol and a low-level C interface.

defaultRawSocketImplClass: aClass
Set which class will be used by default to map between the receiver's protocol and a low-level C interface.

defaultStreamSocketImplClass
Answer the class that, by default, is used to map between the Socket's protocol and a low-level C interface.

defaultStreamSocketImplClass: aClass
Set which class will be used by default to map between the receiver's protocol and a low-level C interface.

isDigitAddress: aString
Answer whether the receiver can interpret aStrnig as a valid address without going through a resolver.

localHostName
Answer the name of the local machine.

loopbackHost
Answer an instance of the receiver representing the local machine (127.0.0.1 in the IPv4 family).

unknownAddress
Answer an instance of the receiver representing an unknown machine (0.0.0.0 in the IPv4 family).


6.15.3 TCP.SocketAddress class: C call-outs

lookupAllHostAddr: name withHostEnt: cObject
Not commented.

primLocalName
Not commented.

primName: address len: len type: addressFamily
Not commented.


6.15.4 TCP.SocketAddress class: host name lookup

allByName: aString
Answer all the IP addresses that refer to the the given host. If a digit address is passed in aString, the result is an array containing the single passed address. If the host could not be resolved to an IP address, answer nil.

byName: aString
Answer a single IP address that refer to the the given host. If a digit address is passed in aString, the result is the same as using #fromString:. If the host could not be resolved to an IP address, answer nil.


6.15.5 TCP.SocketAddress class: initialization

createLocalAddress
Answer an object representing a local address in the address family for the receiver

createLoopbackHost
Answer an object representing the loopback host in the address family for the receiver. By default this is the same as #createLocalAddress, since the loopback host is actually a local address that some implementations optimize specially.

createUnknownAddress
Answer an object representing an unkown address in the address family for the receiver

flush
Flush the cached IP addresses.

newRawSocket
Create a new raw socket, providing access to low-level network protocols and interfaces for the protocol family represented by the receiver (for example, the C protocol family PF_INET for the IPAddress class) Ordinary user programs usually have no need to use this method.

update: aspect
Flush all the caches for IPAddress subclasses


6.15.6 TCP.SocketAddress: accessing

= anIPAddress
Answer whether the receiver and anIPAddress represent the same machine. The host name is not checked because an IPAddress created before a DNS is activated is named after its numbers-and-dots notation, while the same IPAddress, created when a DNS is active, is named after its resolved name.

asByteArray
Convert the receiver to a ByteArray passed to the operating system's socket functions)

hash
Answer an hash value for the receiver

name
Answer the host name (or the digit notation if the DNS could not resolve the address). If the DNS answers a different IP address for the same name, the second response is not cached and the digit notation is also returned (somebody's likely playing strange jokes with your DNS).



Back: TCP.SocketAddress class-initialization Up: TCP.SocketAddress Forward: TCP.SocketImpl   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on May, 22 2008 using texi2html