SocketError SocketInterrupt(
Socket s);
This routine attempts to interrupt a
SocketAccept()
or a
SocketRecv()
pending on the passed socket s.
SocketError SocketInterruptResolve(
TCHAR *domain,
byte *address,
int addrSize);
This routine attempts to interrupt the resolution of the specified address.
This routine takes the following arguments:
Warnings: This function is unreliable. It may not interrupt the desired resolve call,if it executes before the resolve call has begun to be processed. If may also cause other, parallel resolve in the same domain to be interrupted.
SocketError SocketListen(
Socket s,
int qSize);
To listen for incoming sequenced packet or stream connections, call
SocketListen()
. The socket must be bound to a port before it can listen. You may allow more than one connection through the port-specify the maximum number of connections as an argument to
SocketListen()
.
This routine takes the following arguments:
Socket
which should listen for incoming connections. The socket should be bound to a port.
The
SocketListen()
routine causes the passed socket to "listen" for accepting connections. If another socket is already listening at the port, the
SocketListen()
routine will return SE_PORT_ALREADY_LISTENING.
See Also: SocketBind(),
SocketAccept(),
SocketCheckReady().
Include: socket.goh
SocketError SocketOpenDomainMedium(
SocketAddress *addr,
int timeout);
This routine opens a "raw" connection using the specified medium. Exactly what is meant by a "raw" connection depends upon the domain involved. In the case of TCP, this routine will dial the modem and create a PPP connection to the PPP server--but will not send any TCP packets.
If there is already a "raw" connection, this routine will return SE_NORMAL, just as if it had just opened the connection.
If the device's phone is busy, this routine will return SE_MEDIUM_BUSY.
This routine takes the following arguments:
When done with the connection, close it with
SocketCloseDomainMedium()
.
See Also: SocketCloseDomainMedium().
Include: socket.goh
int SocketRecv(
Socket s,
void *buffer,
int bufSize,
int timeout,
SocketRecvFlags flags,
SocketAddress *addr);
The
SocketRecv()
routine receives data from the socket. After filling the passed buffer with data, the socket will discard its copy of the received data to make room for the next piece of incoming data.
To "peek" at the next packet of incoming data, call
SocketRecv()
and pass the SRF_PEEK flag. This allows you to get the size of the next packet of incoming data and even to non-destructively look at the contents of that packet.
When using packet-based delivery type sockets (sequenced packet or datagram delivery sockets), you can only receive whole packets-if you grab data from the socket, but don't grab all the data in the packet, the rest of the data will be lost. Thus, it's a good idea to establish a maximum packet size for sockets using these delivery types.If you're not sure how much room you'll need to receive a packet, call
SocketRecv()
with the SRF_PEEK flag-this allows you to "peek" at the incoming data without causing the socket to discard its copy.
The
SocketRecv()
routine takes the following arguments:
SocketAddress
buffer. Make sure the buffer has room for the address data after the
SocketAddress
structure. The structure's
SA_domain
,
SA_domainSize
, and
SA_addressSize
fields should be initialized. If either the domain or address buffer isn't long enough to hold its string, the resulting truncated string will not be null-terminated.
The
SocketRecv()
routine returns the size of the received buffer. If this size is zero, there may be an error in the connection.
Include: socket.goh
GEOS SDK TechDocs
|
|
SocketGetAddressController() ...
|
SocketRemoveLoadOnMsg() ...