Up: GEOS SDK TechDocs | Up | Prev: SerialGetFormat() ... | Next: SocketBind() ...

SGC_MACHINE

byte	SGC_MACHINE(val);
        dword	val;

This macro is used to extract the machine type from a SysGetConfig() return value.

Include: system.goh

SGC_PROCESSOR

byte	SGC_PROCESSOR(val);
        dword	val;

This macro is used to extract the processor type from a SysGetConfig() return value.

Include: system.goh

SocketAccept()

Socket SocketAccept(
        Socket 		s,
        int 		timeout);

To make a socket wait for and accept a connection, call SocketAccept() . The socket must be a listening socket (processed by SocketListen() ). Because the thread will block until a connection is made or SocketAccept() times out, programs will normally not call this routine in their main execution thread. Instead, a separate thread handles accepting a connection and receiving data from the connection.

If there are no connections to accept, SocketAccept() will set the SE_LISTEN_QUEUE_EMPTY error.

This routine takes the following arguments:

s
A listening socket (processed by SocketListen() ).
timeout
Time to wait for success, in 1/60 second ticks, or SOCKET_NO_TIMEOUT to try as long as possible.

It returns a socket which should be used to send and receive data over the connection. If the return value is zero, an error occured. Call ThreadGetError() to find out what the error value was.

See Also: SocketListen(), SocketConnect(), ThreadGetError().

Include: socket.goh

SocketAddLoadOnMsg()

SocketError SocketAddLoadOnMsg(
        SocketPort 		p,
        SocketLoadType 		slt,
        word 		disk,
        TCHAR 		*path);

To make the Socket library load a program when receiving packets on a particular port, call SocketAddLoadOnMsg() . The Socket library will write out an entry to the GEOS.INI file in the [socket] category and with key "LoadOnMsg". The Socket library consults these GEOS.INI file entries when it starts up and will act accordingly when it receives packets.

This routine takes the following arguments:

p
The port to monitor.
slt
How to load the application--either by UserLoadApplication() or GeodeLoad() .
disk
DiskHandle of application to load. This may be a StandardPath value.
path
Buffer holding path of application to load.

If successful, the routine will return SE_NORMAL (i.e., zero). Otherwise, it will return some other SocketError value.

See Also: SocketAddLoadOnMsgInDomain(), SocketRemoveLoadOnMsg(), UserLoadApplication(), GeodeLoad().

Include: socket.goh

SocketAddLoadOnMsgInDomain()

SocketError SocketAddLoadOnMsgInDomain(
        SocketPort 		p,
        SocketLoadType 		slt,
        word 		disk,
        TCHAR 		*path,
        TCHAR 		*domain);

To make the Socket library load a program when receiving packets on a particular port within a particular domain, call SocketAddLoadOnMsgInDomain() . The Socket library will write out an entry to the GEOS.INI file in the [socket] category and with key "LoadOnMsg". The Socket library consults these GEOS.INI file entries when it starts up and will act accordingly when it receives packets.

This routine takes the following arguments:

p
The port to monitor.
slt
How to load the application--either by UserLoadApplication() or GeodeLoad() .
disk
DiskHandle of application to load. This may be a StandardPath value.
path
Buffer holding path of application to load.
domain
Buffer holding name of the domain to monitor.

If successful, the routine will return SE_NORMAL (i.e., zero). Otherwise, it will return some other SocketError value.

See Also: SocketAddLoadOnMsg(), SocketRemoveLoadOnMsgInDomain(), UserLoadApplication(), GeodeLoad().

Include: socket.goh


Up: GEOS SDK TechDocs | Up | Prev: SerialGetFormat() ... | Next: SocketBind() ...