typedef word Socket;
A Socket represents one side of a communication managed by the Socket library.
Include: socket.goh
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:
SocketPort
structure.
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.
SocketAddress
structure. This means that you should have allocated memory for SA_domain, and initialized
SA_domain
and
SA_domainSize
.
SA_addressSize
field contains the size of the address data. The buffer containing the address data should fall immediately after the
SocketAddress
structure.
SocketAddress
structure. This means that you should leave room for address data after the structure and initialize the
SA_addressSize
field.Include: socket.goh
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.
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:
Include: socket.goh
SocketDeliveryType;
#define SDT_DATAGRAM 0x0 /* unreliable packets */
#define SDT_SEQ_PACKET 0x1 /* reliable packets */
#define SDT_STREAM 0x2 /* reliable bytes */
Include: socket.goh
GEOS SDK TechDocs
|
|
SerialBaud ...
|
SocketError ...