|
Start a new thread, wait for connections and start socket_accept_do() when someone connects.
-
Parameters:
-
sockport |
(int) descriptor of a tcp socket/port from socket_bind() |
id |
(int) arbitrary id of background process / thread. (May be it is a good idea to use the portnumber.) |
aocket_accept_do |
(int fd, int id, char *pip, struct sockaddr_in their_addr) (function) this function is called if somebody connects. fd is the descriptor of the new socket to the connected tcp-tream. id is the same as in socket_accept(). pip contains the ip-address of the connected client. The structure their_addr contails all known information about the connected client. |
-
Returns:
-
If all right zero otherwise non zero.
|