c - how to pass socket control to child process? -


i have written small proxy server listens on port 25 , set of operations.

in case of secure smtp, fork process , let child process take on session.

the thought process child process should 1 caters particular clients requests. if there client sending mails (secured) , need fork process.

but whats happening once child process has processed clients requests, keeps on listening, not cater client. parent process listening on socket, forks new process every time.

how can handle situation? if process has been forked client(ip address), new forking should not happen. existing child process should handle these requests.

the program c based , running on linux.

retain sender's information in client process. when receive new smtp message check if sender same before. if is, not fork new client.

if not answer question please include essential parts of code can see logical fault might reside.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -