ClassStruct * SocketGetAddressController(
char *domain)
Given a domain name, you can create some UI gadgetry for choosing addresses within that domain. Call
SocketGetAddressController()
to get the class of an appropriate controller.
This routine takes a buffer containing the name of the domain for which to create a controller. It returns a
ClassStruct
pointer which may be passed to
ObjInstantiate()
.
For API information about address controllers, see XXX XREF Socket chapter XXX.
If the routine returns zero, there was an error. Call
ThreadGetError()
to find out what the error was (it will be a
SocketError
value). Look out for SE_UNKNOWN_DOMAIN.
See Also: SocketGetDomains(),
ObjInstantiate().
Include: socket.goh
SocketError SocketGetAddressMedium(
SocketAddress *sa,
MediumAndUnit *mau);
To find out which port would be used to connect to a given address, call
SocketGetAddressMedium()
. The socket need not actually be connected. Depending on the medium to be used, you might try to connect to the other site via some other domain or to not make the connection at all.
Include: socket.goh
int SocketGetAddressSize(
char *domain);
To find out the maximum address data size for a given domain, call
SocketGetAddressSize()
. This can be helpful when allocating memory large enough to handle a full address.
This routine returns zero on error. Call ThreadGetError() to find out what the error was--if
ThreadGetError()
returns zero, then there wasn't really an error; this domain just doesn't require an address buffer.
Include: socket.goh
ChunkHandle SocketGetDomainMedia(
char *domain,
optr mediaList);
If you're ever curious to know which sort of hardware ports the user's machine uses to connect up to a given domain, call
SocketGetDomainMedia()
. This returns a chunk array of
MediumType
structures. If you have a choice of domains to make a given connection, you might consider which medium would be used to make the connection.
Include: socket.goh
ChunkHandle SocketGetDomains(
optr domainList);
The
SocketGetDomains()
routine takes the optr of a chunk array and fills in said array with elements, each of which contains a string, each string being the name of a supported domain. This chunk array has a standard
ChunkArrayHeader
header and variable sized elements.
If the return value is zero, there was an error. Call
ThreadGetError()
to find out what it was.
Include: socket.goh
SocketError SocketGetMediumAddress(
char *domain,
bye *buffer,
int *bufsize,
MediumAndUnit *mau);
This routine determines the local address of the connection using a particular medium. If another machine were to connect to this machine via that medium, this is the address it would use.
This routine takes the following arguments:
If the routine returns SE_NORMAL, then the address was computed successfully. The buffer buffer will be filled with as much of the address data as fit; the bufsize number will have changed to the total size of the address data--if this was larger than the size of buffer, then the address was truncated.
SocketError SocketGetPeerName(
Socket s,
SocketAddress *addr);
If a socket is connected, call
SocketGetPeerName()
to get the address of the socket at the other end of the connection.
This routine takes the following arguments:
SocketAddress
structure. The
SA_domain
,
SA_domainSize
, and
SA_addressSize
fields should be initialized. The buffer should be large enough to hold a
SocketAddress
structure and address data.
It returns SE_NORMAL (i.e., zero) if there was no error; otherwise it will return some
SocketError
value. The addr buffer will be filled in with address information. If either the domain name or address buffer isn't large enough to hold its string, the resulting truncated string will not be null-terminated.
Include: socket.goh
SocketError SocketGetSocketName(
Socket s,
SocketAddress *addr);
To find out the address used to represent the socket's own side of the connection, call
SocketGetSocketName()
.
This routine takes the following arguments:
SocketAddress
structure. The
SA_domain
,
SA_domainSize
, and
SA_addressSize
fields should be initialized. The buffer should be large enough to hold a
SocketAddress
structure and address data.
It returns SE_NORMAL (i.e., zero) if there was no error; otherwise it will return some
SocketError
value. The addr buffer will be filled in with address information. If either the domain name or address buffer isn't large enough to hold its string, the resulting truncated string will not be null-terminated.
Include: socket.goh
int SocketGetIntSocketOption(
Socket skt,
SocketOption opt);
This routine checks one of a socket's options, returning the current setting for that option. The return value's meaning depends upon the passed
This routine takes the following arguments:
GEOS SDK TechDocs
|
|
SocketClose() ...
|
SocketInterrupt() ...