Up: GEOS SDK TechDocs | Up | Prev: SerialBaud ... | Next: SocketError ...

Socket

typedef word Socket;

A Socket represents one side of a communication managed by the Socket library.

Include: socket.goh

SocketAddress

typedef struct {
        SocketPort  SA_port;
        word        SA_domainSize; 					/*  size in bytes of SA_domain buffer */
        char        *SA_domain; 					/*  null terminated domain name */
        word        SA_addressSize; 					/*  size in bytes of address data */
} SocketAddress;

Addresses are made up of a port number, a domain, and address data:

SA_port
Port numbers identify a particular line of communication within a machine. Port numbers may be 32-bit or 16-bit, depending on the domain. They are specified via the SocketPort structure.
SA_domain , SA_domainSize
The domain identifies the protocol of the network by which the addressed machine may be reached. The domain is specified by a string. SA_domain is a pointer to the null-terminated domain name string and SA_domainSize is the size of the buffer containing the domain name string.
Some routines are passed an empty SocketAddress structure. This means that you should have allocated memory for SA_domain, and initialized SA_domain and SA_domainSize .
SA_addressSize , Address Data
The format of the address data used to identify a machine within a domain depends on that domain. The SA_addressSize field contains the size of the address data. The buffer containing the address data should fall immediately after the SocketAddress structure.
Some routines are passed an empty SocketAddress structure. This means that you should leave room for address data after the structure and initialize the SA_addressSize field.

Include: socket.goh

SocketBindFlags

typedef WordFlags SocketBindFlags;
        #define SBF_REUSE_PORT  (0x8000) 

These flags are used to specify options when binding a socket to a port.

There is only one flag: SBF_REUSE_PORT, requesting that the socket be bound to the port even if another socket is already bound to it. You may not use this flag with datagram sockets.

SocketCheckRequest

typedef struct {
        word 		SCR_socket;
        SocketCondition 		SCR_condition;
        byte 		SCR_reserved;
} SocketCheckRequest;
typedef ByteEnum SocketCondition;
        #define SC_READ 			0x0 			/*  data arrived */
        #define SC_WRITE 			0x1 			/*  data can be written */
        #define SC_ACCEPT 			0x2 			/*  connect request arrived */
        #define SC_EXCEPTION 			0x3 			/*  an exception occurred */
        #define SC_URGENT 			0x4 			/*  urgent data arrived */

A SocketCheckRequest is used to query a socket about whether it is ready to carry out some operation. You will need to set two fields:

SCR_socket
The socket to query.
SCR_condition
The operation to query about.

Include: socket.goh

SocketCondition

See SocketCheckRequest .

typedef ByteEnum

SocketDeliveryType

SocketDeliveryType;
        #define SDT_DATAGRAM 			0x0 		/*  unreliable packets */
        #define SDT_SEQ_PACKET 			0x1 		/*  reliable packets */
        #define SDT_STREAM 			0x2 		/*  reliable bytes */

Include: socket.goh


Up: GEOS SDK TechDocs | Up | Prev: SerialBaud ... | Next: SocketError ...