Up: GEOS SDK TechDocs | Up | Prev: SocketInterrupt() ... | Next: SoundAllocMusic() ...

SocketRemoveLoadOnMsg()

SocketError SocketRemoveLoadOnMsg(
        SocketPort p);

If you've requested the Socket library to load a program when it senses packets coming to a port, you can undo that request by calling SocketRemoveLoadOnMsg() .

See Also: SocketAddLoadOnMsg().

Include: socket.goh

SocketRemoveLoadOnMsgInDomain()

SocketError SocketRemoveLoadOnMsgInDomain(
        SocketPort 		p,
        TCHAR 		*domain);

If you've requested the Socket library to load a program when it senses packets coming to a port in a given domain, you can undo that request by calling SocketRemoveLoadOnMsgInDomain() .

See Also: SocketAddLoadOnMsgInDomain().

Include: socket.goh

SocketResolve()

int SocketResolve( 
        char 		*domainName,
        byte 		*rawAddr,
        int 		addrSize,
        byte 		*result,
        int 		resultBuffSize );

You cannot use an address with other Socket library routines unless that address is in its most primitive form. This primitive form is created by taking a higher-level form of the address and passing it to the SocketResolve() routine. You will recall that addresses returned by the address controller will not be in their most primitive form. The primitive form of an address can be volatile: feel free to re-use them if making several connections over a short period of time, but re-resolve the address if it's been a long time since it was last resolved. Note that there can be a large overhead when it comes to resolving addresses.

This routine takes the following arguments:

domainName
Buffer containing null-terminated domain name string.
rawAddr
Buffer containing the unresolved form of the address. Normally, this will be the buffer at the end of a SACAddress returned by a SocketAddressControl in response to MSG_SOCKET_ADDRESS_CONTROL_GET_ADDRESSES .
If you aren't resolving an address from a SocketAddressControl, but in fact need to construct a raw address from scratch, see the documentation for SACAddress .
addrSize
Size of the rawAddr buffer, normally the SACA_opaqueSize field from a SACAddress returned by a SocketAddressControl in response to MSG_SOCKET_ADDRESS_CONTROL_GET_ADDRESSES .
result
Buffer to hold the resolved address. This will normally be a buffer trailing a SocketAddress structure.
resultBufferSize
Size of the result buffer.

It returns the size of the resolved address. If it returns zero, there was an error. Call ThreadGetError() to find out what the error was. Typical errors to look out for are SE_BUFFER_TOO_SMALL, SE_DESTINATION_UNREACHABLE, and SE_TEMPORARY_ERROR.

Include: socket.goh

SocketSend()

SocketError SocketSend(
        Socket 		s,
        void 		*buffer,
        int 		bufSize,
        SocketSendFlags 		flags,
        SocketAddress 		*addr);

The SocketSend() routine sends data over a socket. It takes several arguments:

s
The socket through which to send the data
buffer
A buffer containing the data to send
bufSize
The size of the data buffer.
flags
Options to use when sending. Set SSF_ADDRESS if you're passing an address in addr . Set SSF_URGENT to mark the packet urgent.
addr
Address to which to send data.
If the socket is a sequenced packet or stream delivery type socket, then this optional address will be ignored.
If the socket is a datagram delivery type socket, specify the destination address of the packet here unless the socket has a default destination address as described below.
Datagram sockets can use the SocketConnect() routine to specify a default destination address. If they have no default address, then you must specify the destination address for the packet here. If there is a default destination address and you pass this optional address and those addresses do not match, then the Socket library will generate a fatal error.

Normally, SocketSend() will return SE_NORMAL. If it detects an error, it may return some other SocketError value.

Include: socket.goh

SocketSetIntSocketOption()

void	SocketSetIntSocketOption(
        Socket		skt,
        SocketOption		opt,
        int		newval);

This routine changes the setting for one of a socket's options.

This routine takes the following arguments:

skt
The socket.
opt
Which option to change. The following options are available:
SO_RECV_BUF: the maximum size of the socket's buffer for incoming data. A value of -1 means no limit.
SO_SEND_BUF: the maximum size of the socket's buffer for outgoing data. A value of -1 means no limit.
SO_INLINE: Non-zero if urgent data is forced into the same queue as regular data; zero to treat urgent data specially.
SO_NODELAY: Non-zero if domain driver should send all packets immediately; zero to allow the driver to save up packets to send as larger blocks.
SO_OWNER: Specify a new owning thread for the Socket.
newval
The new setting for the option. The meaning of this value depends on which option you are changing.

Include: socket.goh


Up: GEOS SDK TechDocs | Up | Prev: SocketInterrupt() ... | Next: SoundAllocMusic() ...