Socket: 10.1 Domain-Specific Information: TCP/IP--GEOS Specific

Up: GEOS SDK TechDocs| Up | Prev: 10 Domain-Specific Information | Next: 10.2 TCP/IP--Standard

The TCP/IP domain is a popular standard used for internet communications. The GEOS-specific version supports 32-bit port numbers. GEOS TCP/IP data may be transmitted via a regular TCP/IP network, though both the sending and receiving machines must support GEOS TCP/IP.

Domain Name:
"TCPIP_GEOS "
Port Numbers:
32-bit values.
Opaque Address Format:
This address will be either a TcpAccPntExtendedAddress ,a TcpOnlyExtendedAddress , or a TcpNonAccPntExtendedAddress .
TcpAccPntExtendedAddress: Use this structure when referring to an address identified by an access point ID number.
TcpOnlyExtendedAddress: Use this structure to identify a TCP address by its address instead of by its ID.
TcpNonAccPntExtendedAddress: Use this structure to identify a TCP address that is not a known access point. You will need to specify a link address (a phone number) as well as an IP address.
Notes:

Code Display 23-2 Making the Raw TCP/IP Connection

Here we see three snippets of code from the Talk sample application
The AccessPointControl allows the user to choose an ISP:

@chunk char accpntMkr[] = "Access List";
@object AccessPointControlClass AccpntControl = {
	GI_states = GS_USABLE|GS_ENABLED;
	HINT_ACCESS_POINT_CONTROL_MINIMIZE_SIZE;
	ATTR_ACCESS_POINT_CONTROL_LIST_MONIKER = @accpntMkr; }

In @method TalkAddressClass, MSG_GEN_GUP_INTERACTION_COMMAND, we get information we'll need about the ISP

point = @call \
GeodeGetOptrNS(@AccpntControl)::MSG_ACCESS_POINT_CONTROL_GET_SELECTION();
/* store link info into address buffer */
rawAddress.UTA_link.TAPEA_linkSize = 3;
rawAddress.UTA_link.TAPEA_linkType = LT_ID;
rawAddress.UTA_link.TAPEA_accPntID = point;
/* the text of the address follows the link info */
alen = @call GeodeGetOptrNS(@IPText)::MSG_VIS_TEXT_GET_ALL_PTR( 
						(char *)&(rawAddress.UTA_ip[0]));
if (alen > MAX_IP_ADDR_STRING_LENGTH) FatalError(0);  /* too much text */
/* resolve the raw address into a SocketAddress */
theAddress.SA_addressSize = SocketResolve(theAddress.SA_domain,
					(byte *)(&rawAddress),
					sizeof(TcpAccPntExtendedAddress)+alen,
					(byte *)(&addressBuffer),
					MAX_ADDRESS_SIZE);

In MSG_CTP_CONNECT's handler, we make the PPP connection:

rval = SocketOpenDomainMedium((SocketAddress *) &theAddress, SOCKET_NO_TIMEOUT);
#define  ECHO            7  /* TCP/UDP */
#define  DISCARD         9  /* TCP/UDP */
#define  FTP_DATA        20 /* TCP */
#define  FTP             21 /* TCP */
#define  TELNET_SERVER   23 /* TCP */
#define  NAME_SERVER     42 /* UDP */
#define  WHOIS           43 /* TCP */
#define  DOMAIN_SERVER   53 /* TCP/UDP */
#define  FINGER          79 /* TCP */

Up: GEOS SDK TechDocs| Up | Prev: 10 Domain-Specific Information | Next: 10.2 TCP/IP--Standard